sanctuary-pipep
v1.0.2
Published
adds async / await functionality to sanctuary pipe
Downloads
1
Readme
sanctuary-pipeP
Adds async / await functionality to sanctuary pipe.
Example
// Import sanctuary.
const Sanctuary = require('sanctuary');
// /Import pipeP and env from sanctuary-pipeP
const { pipeP, env } = require('sanctuary-pipeP');
// Setup Sanctuary environment to include sanctuary-pipeP Promise type.
const S = Sanctuary.create({
checkTypes: true,
env: Sanctuary.env.concat(env)
});
// create asynchronous pipe
const pipe = pipeP([
(x => Promise.resolve(x + 1)),
S.add(1)
]);
// enjoy
pipe(1).then(console.log); // should output 3