Network Processor Module
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    fork-futurepublic

    fork-future

    build status npm version codecov.io

    Pointfree forking Futures

    Example

    const Task = require('data.task');
    const fork = require('fork-future');
     
     
    const timeout = (msg, time) => new Task((reject, resolve) => setTimeout(() => resolve(msg), time));
     
    const forkAndLog = fork(onRejected, (result) => {
      console.log('RESULT', result);
    });
     
    forkAndLog(timeout('POINTFREE', 3000));

    API

    fork :: (a -> *) -> (b -> *) -> Future -> *

    fork(onRejected)(onResolved)(future)

    forkToPromise :: (Future a b) -> (Promise a b)

    const forkToPromise = require('fork-future').forkToPromise;
     
    // Fork, then continue using a promise chain.
    forkToPromise(future).then(...)
     
    // Use async/await (if supported in your environment).
    await forkToPromise(future)

    License

    MIT © stoeffel

    install

    npm i fork-future

    Downloadsweekly downloads

    2

    version

    0.1.0

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar