Share your code. Components are building blocks, you are the architect.

utils/compose-p
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Performs right-to-left composition of one or more Promise-returning

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use utils/compose-p in your project
npm i @bit/bit.ramda.utils.compose-p
Copied

composeP (functions:...Function) : Function

Performs right-to-left composition of one or more Promise-returning functions. The rightmost function may have any arity; the remaining functions must be unary.

Example

var db = {
       users: {
         JOE: {
           name: 'Joe',
           followers: ['STEVE', 'SUZY']
         }
       }
     }

     // We'll pretend to do a db lookup which returns a promise
     var lookupUser = (userId) => Promise.resolve(db.users[userId])
     var lookupFollowers = (user) => Promise.resolve(user.followers)
     lookupUser('JOE').then(lookupFollowers)

     //  followersForUser :: String -> Promise [UserId]
     var followersForUser = R.composeP(lookupFollowers, lookupUser);
     followersForUser('JOE').then(followers => console.log('Followers:', followers))
     // Followers: ["STEVE","SUZY"]

Argument

functions: ...Function

The functions to compose

Returns

Function