Nicer API
See original GitHub issueHi, thanks for the amazing helper.
When using this library in conjunction with lodash/fp, I found that the API would be much more powerful if the argument order was changed (iteratee first, data last), and if it was curried, in the spirit of lodash-fp.
I usually define a function called mutate
this way:
const mutate = (getter,setter,context?) => (state) => iassign(state,getter,setter,context,{freeze:true})
The resulting function mutate
is extremely helpful, as it allows to represent “mutations” in a declarative way. These mutations can then be applied to data. Here is an example of use:
const reducer = (state = initialState, action) => {
switch (action.type) {
case "TICK":
return mutate(
state=>state.time,
time=>time+1
)(state)
...
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
nICEr/api.txt at master · resiprocate/nICEr - GitHub
action completes. So, this is standard event-driven programming. The ICE API exports the following major data structures: - nr_ice_ctx -- a single ...
Read more >NICE CXone RESTful APIs
Develop customizations and integrations with confidence using the same proven APIs used to create NICE CXone products and features. Utilize tested and validated ......
Read more >7 Nice API for your projects ! - DEV Community
7 Nice API for your projects ! · Movie database (IMDB) · Food Recipes (spoonacular) · Rick & Morty database · Random Advice...
Read more >REST API for the BETTER Application - better-lbnl
The BETTER API operates as a simple REST-based api for creating, updating and deleting building and portfolios, and their related analytics. Like most...
Read more >NICE syndication API | What we do | About
NICE syndication API · makes NICE content accessible through your platforms, systems and services · ensures you always have access to the most...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, I just meant to move the
option
parameter first, not to reverse the argument order completely.Auto currying is excellent !
Hi, thank you this is very nice.
However there is only one thing that could be made better: The order of argument could be changed in order to make this more useful: In the curried form, the
options
should be the first argument and not the last.Also, to match
lodash/fp
, and as a matter of usability, it would be nice if it was autocurried, which means that we can call the function with any number of arguments, and it would be curried accordingly.This would allow to write things like that
I asked for this feature in your package, because otherwise I would have had to create a fork of your package just to implement this small change.
If you want I can code this and make a pull request. However you are really close right now