Closed skipkayhil closed 4 years ago
Hello @SkipKayhil, thank you for this PR!!
I agree with your changes, the state updates are now more direct.
Hopefully I will be able to work on hyperstatic soon 🙏 I want to see if it's possible to remove the dependency on the lifecycle events from the library, since it's not in line with hyperapp's way of doing things.
I will test & merge it over the weekend, thanks!!
Hello again,
I've been looking into more ways to optimize Hyperstatic, and I while this is a small change I think it reduces code complexity in a good way. While the
popstate
event is fired by the browser (on browser back button),pushstate
is only fired by theChangeLocation
effect. Instead of firing the event in the effect, I think it is a lot more clear to use theParseUrl
action inNavigate
and only have theChangeLocation
effect update thehistory
.This PR is probably a little more opinionated than the last one (especially with function names), and I'm willing to make any changes you suggest.