purescript-react / purescript-react-basic-hooks

An implementation of React hooks on top of purescript-react-basic
https://pursuit.purescript.org/packages/purescript-react-basic-hooks/
Apache License 2.0
200 stars 33 forks source link

React.memo with argument #61

Closed andys8 closed 2 years ago

andys8 commented 2 years ago

Adding another variant of memo that allows passing a function to compareprevious and new props.

https://reactjs.org/docs/react-api.html#reactmemo

I'm open to any name changes and other suggestions.

Solves https://github.com/megamaddu/purescript-react-basic-hooks/issues/60

megamaddu commented 2 years ago

Thanks! I kind of want to deprecate/rename the existing memo.. Ref equality in PS is weird...