sanctuary-processp

1.0.2 • Public • Published

sanctuary-processP

Adds synchronous and async / await process functionality to sanctuary. A process waits for all of its tasks to be finished.

Actions Status Actions Status Run on Repl.it

Example

// Import sanctuary.
const Sanctuary = require('sanctuary');

// Import processP and env from sanctuary-processP
const { processP, env } = require('sanctuary-processP');


// Setup Sanctuary environment to include sanctuary-processP Promise type.
const S = Sanctuary.create({
  checkTypes: true,
  env: Sanctuary.env.concat(env)
});


// create list of processes
const processes = processP([
  (x => Promise.resolve(x + 1)),
  S.add(2)
]);


// enjoy
processes(1).then(console.log); // should output [2, 3]

Readme

Keywords

Package Sidebar

Install

npm i sanctuary-processp

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

5.89 kB

Total Files

8

Last publish

Collaborators

  • beesperester