Closed henryluki closed 7 years ago
Promise-returning functions that do not change state should not be defined as effects. Instead, they should be defined as a helper function. In freactal parlance, an effect is a promise-returning function whose resolution value is a function that reduces old state into new state.
If I misunderstood the question, however, please let me know and feel free to re-open the issue. I'm going to close the associated PR as well. But again, if I'm missing something, please just let me know! :)
For example, effects like this:
Use it:
In this case,
commentVote
doesn't change state.Promise.resolve
returns an object.