-
Notifications
You must be signed in to change notification settings - Fork 6
Simplified values
function with basic example
#7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Is this project dead? |
oh thats quite nice, but some people file ternaries and arrow functions confusing.... it's not dead, it's just finished. I get lots of issue emails, and didn't notice your first one go past, sorry |
Hi, I mention pull-streams as an inspiration in my new library here: Would love to hear your opinion on it! |
Just noticed you mentioned my version mutates the array, will look into it... |
This is interesting to hear, because I am often rewriting code with arrows and ternaries for myself to make it more understandable and less confusing for me, I suppose these things are very subjective :) |
yes, I guess I have spent a lot of time looking at |
oh your CPS thing looks like the same pattern as https://www.npmjs.com/package/continuable |
Thanks, I noticed it also links to some of your projects, I wonder what happened to them... I have been looking for related projects for inspiration and validations for With promises you have the separate 2nd callback for error handling. This was one of the motivation for
Thanks, the idea was indeed to try to make it dead easy to drop any cb-function into |
hmm, async programming is really about error handling. so that makes me curious about your approach. for functional programming, I just want a consistent approach, say always callbacks etc... but as every error is unique ... when you say any number of callbacks do you mean more the |
My main point is, JS functions are multi-argument by design, so we can embrace and exploit this existing functionality with relatively little efforts. Totally with you about consistency, all CPS functions have the same uniform signature: (...calbacks) => { ... any code here ... } My aim is to embrace only parts of what is associated with functional programming. One often mentioned principle is that of purity or side-effect-free, which is somewhat orthogonal here. As JS functions are allowed to be non-pure by design, so does the Another FP part that I regard as orthogonal is typing. On the other hand, the compositional part of the FP is fully embraced,
I mean writing your CPS functions like that: const cpsFn = (onResult, onSyntaxError, onServerError) => { ... } which extends the promise 2-callbacks-only approach. So instead of single callback call And taking this to the next level, I have been trying to write some comprehensive introduction in https://github.com/dmitriz/cpsfy/blob/master/DOCUMENTATION.md |
Closing in favour of #8 |
Just an obvious simplification and really basic example to see how pulling data works,
could be helpful for a beginner trying to understand how it work.
I wonder if you would accept this PR and similar style simplification for other functions?