Comments (24)
Yep, the plan is to implement it. Checkout out the first comment of this issue. It is the first function to be implemented for this issue ;]
from ramda-adjunct.
resolveP = bind(Promise.resolve, Promise);
from ramda-adjunct.
Something like https://github.com/kirillrogovoy/promised-pipe might also be useful.
from ramda-adjunct.
@rockymadden isn't pipeP what you're looking for ?
from ramda-adjunct.
If all functions are return promises, yes. The promised-pipe brings the ability to intermix, at any point, sync and async functions.
from ramda-adjunct.
pipeP does the same. The only requirement is that first function in the pipe must be promise generator (returns promise).
const { add, subtract } = require('ramda');
const resolveP = Promise.resolve.bind(Promise);
const asyncAdd = val => resolveP(val).then(add(1));
pipeP(
resolveP,
add(1),
subtract(1),
asyncAdd,
add(2),
subtract(1)
)(1);
from ramda-adjunct.
Nice, hmm yeah ignore me then. Thanks! BTW, I see some of what you are laying out here mentioned through out various Ramda issues on the topic of Promises (e.g. ramda/ramda#1869 (comment)). Lovely idea.
from ramda-adjunct.
NP
from ramda-adjunct.
Thoughts on your resolveP
function (or R.bind(Promise.resolve, Promise)
) being made into a standard function in adjunct (e.g. resolveP
or ofP
)? Seems to be generally usable to kick things off as a Promise.
EDIT: Ignore, I see it now as the first function in the list above.
from ramda-adjunct.
You can provide a pull request for it if you wish and become a contributor. ramda-adjunct ecosystem is ready to receive PR's and I always welcome any help. What do you think ?
from ramda-adjunct.
Yep, love it. I've had a subset of this library internally for a while. Was reading through the Ramda wiki and saw ramda-adjunct
, which was exactly what I myself was doing.
from ramda-adjunct.
Yep, I guess everybody is doing it. This library has a potential saving a lot of development time to a lot of people. Check this article to find out more.
Great, check out the CONTRIBUTING.md and you can start right away.
from ramda-adjunct.
Further inspirations: https://github.com/krainboltgreene/unction.js?files=1
from ramda-adjunct.
https://stackoverflow.com/questions/27746304/how-do-i-tell-if-an-object-is-a-promise
from ramda-adjunct.
@char0n You OK if I bump this to 2.7.0?
from ramda-adjunct.
Bump it up or remove the milestone entirely. Have no usecases for the rest of them right now.
from ramda-adjunct.
@char0n When you get a chance maybe move remaining to separate issues.
from ramda-adjunct.
Yeah me or anybody else can do that.
Note for me and others: when doing it reference this issue in the child issues just for reference and then close this one.
from ramda-adjunct.
since #676, additional candidates are :
- mapP
- filterP
- rejectP
IMO, we need to talk about parallel and series behavior, isn't ?
from ramda-adjunct.
Yes I think we should and I'm very interested in this discussion. But I'm still thinking about this in a context of already implemented reduceP. Does it make sense to have reduceP work in a parallel mode ?
Can you provide example of mapP
being parallel and serial ?
from ramda-adjunct.
Created separate issue for raceP
from ramda-adjunct.
created separate issue for catchP
from ramda-adjunct.
created separate issue for thenCatchP
from ramda-adjunct.
Not going to implement tapP for now.
from ramda-adjunct.
Related Issues (20)
- incorrect ponyfill for replaceAll() HOT 5
- Add support for [email protected]
- Isolate test:ramda to nightly build
- Broken link in documentation for lensTraverse HOT 3
- Type of compact does not match the constraint it applies HOT 1
- RA.Identity monad not showing in docs HOT 2
- Fix invokeArgs typings
- clamp HOT 4
- can not install v2.31.0 - post install - husky install failes HOT 2
- Add .mocharc.js and .husky to .npmignore HOT 2
- Typo in the documentation HOT 3
- Discontinue using of `test/shared`
- Add support for [email protected] HOT 2
- Make this library usable in denoland
- Cannot read property 'length' of undefined HOT 3
- Cannot re-export all of ramda-adjunct in TypeScript HOT 3
- Make CI run on Node 18 HOT 1
- Remove .nvmrc from npm package
- Add support for [email protected] HOT 1
- allP types are wrong HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ramda-adjunct.