Nasal Piercings Manipulator

    taken

    1.0.0 • Public • Published

    Taken

    Not Your Mother's FRP framework.

    A simple, lightweight JavaScript Framework for handling FRP.

    Installation

    Include the script:

    <script src="/path/to/taken.js"></script>
    npm install taken
    
    var T = require('taken');

    Usage

    Channels can be saved globally with

    T( *ChannelName* ).map

    or as a variable with

    var ChannelName = T().map

    Listen to channel:

    T('xyz').map(function(value){
      console.log(value);
    });

    or

    var myChannel = T().map(function(value){
      console.log(value);
    });

    Send to channel

      T('xyz')('Hello World!');

    or

      myChannel('Hello World!');

    Listen to multiple channels:

    T('xyz abc').map(function(value){
      console.log(value);
    });

    or

    var myChannels = T('xyz abc').map(function(value){
      console.log(value);
    });

    Send to multiple channels:

    T('xyz abc')('Hello World!');

    or

    myChannels('Hello World!');

    Historic merge:

    T('xyz zyx').historic(function(xyz, zyx){
      console.log(xyz, zyx);
    });
     
    T('xyz')('Hello'); //Hello undefined
    T('zyx')('World!'); //Hello World!
    T('xyz')('Goodbye'); //Goodbye World!

    Forwarding to channel:

    T('merged').map(function(value){
      console.log(value);
    });
    T('xyz').map(T('merged'));
    T('zyx').map(T('merged'));
     
    T('xyz')('Hello'); //Hello
    T('zyx')('World!'); //World!

    or

    var Merged = T();
      
    T('xyz').map(T(Merged));
    T('zyx').map(T(Merged));

    Chaining:

    T('xyz').map(function(value, next){// value == 0
      next(value + 1); //Next function in chain is called with value passed to next
    }).map(function(value, next){// value == 1
      next(value + 1);
    }).map(function(value){// value == 2
      console.log(value);
    });

    Filtering:

    T('xyz').map(function(value, next){
      val<10 && next(value); //If val is less than ten, continue with chain.
    }).map(function(value){
      console.log(value); //5
    });

    Intervals:

    T('xyz').intervals(300);
     
    T('xyz').map(function(){ //Every 300 miliseconds
      console.log(Date.now());
    });

    Authors

    Joe Reeve

    Install

    npm i taken

    DownloadsWeekly Downloads

    2

    Version

    1.0.0

    License

    ISC

    Last publish

    Collaborators

    • isnit