Open voronianski opened 7 years ago
Also I'm a bit confused that inside choo.js onStateChange
function has different signature - https://github.com/yoshuawuyts/choo/blob/master/index.js#L89
@yoshuawuyts I really like the concepts and minimal API of the library and would like to use it inside of my project but this issue stops me for now.
currently thinking of actually ditching the prev
argument because it causes a fair amount of complexity in the API - wouldn't rely on it tbh
Instead you can hold your own reference to the prev instance of state
, for example inside a closure (:
Please take a look at my example (pls open console to see logs).
On every
'counter:increment'
actiononStateChange
handler logs the same values forstate.counter.count
instate
andprev
objects:Is it intended?