If I’m reading the documentation correctly, and an effect is a “(1) function that … returns (2) a promise that resolves to (3) a function that takes in state and returns (4) the updated state,” then I think the second and third examples are wrapping the state transform in the Promise in the wrong order… reversing (2) and (3).
If I’m reading the documentation correctly, and an effect is a “(1) function that … returns (2) a promise that resolves to (3) a function that takes in state and returns (4) the updated state,” then I think the second and third examples are wrapping the state transform in the Promise in the wrong order… reversing (2) and (3).
See: https://github.com/FormidableLabs/freactal#transforming-state-cont
My changes are consistent with the subsequent README example:
... in that the
state => transform( state )
is what thePromise
resolves to.I'm brand new to this repo, so forgive me if this pull request is premature.