This is interesting and I am going to try it, I just don't understand what is happening with that wrapper.
Where does the read method come from?
It's like you want the result of the parameter to the method.
(I will still give it a go. If it works, it works).
The next question I would ask would be if you need to pass a parameter to the API.
I guess you would just need to create a method to return this method (:P) and "read" it from a callback. (or do it the old way)
Until this is actually ready, I might stay away, but it makes me want to try and create a wrapper function for an API call that would return the result of a reducer (if that makes sense).
The loading state would still need to be managed.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is interesting and I am going to try it, I just don't understand what is happening with that wrapper.
Where does the read method come from?
It's like you want the result of the parameter to the method.
(I will still give it a go. If it works, it works).
The next question I would ask would be if you need to pass a parameter to the API.
I guess you would just need to create a method to return this method (:P) and "read" it from a callback. (or do it the old way)
I'll send you two examples from React that answer your questions.
You can see the implementation of that method here.
And here is how you pass a parameter.
That is nicely put.
Until this is actually ready, I might stay away, but it makes me want to try and create a wrapper function for an API call that would return the result of a reducer (if that makes sense).
The loading state would still need to be managed.