collegevine / purescript-elmish-hooks

React hooks for Elmish
https://collegevine.github.io/purescript-elmish-hooks
MIT License
7 stars 1 forks source link

Re-runnable useEffect #7

Closed mcordova47 closed 2 years ago

mcordova47 commented 2 years ago

Another go at a re-runnable useEffect hook. Still feels a bit questionable, though. Basically, the idea is:

Old Idea

New Idea

Use componentDidUpdate and then check if the dependencies changed and, if so, run the effect again.

I also rearranged the way the name gets generated to fix the name generation for useState and useEffect.

mcordova47 commented 2 years ago

just make your own React class and FFI it into PureScript (similar to what browserEvents does)

Ahhh, good idea!