You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to have direct replacements for or at least an explanation of how one would emulate every hoc from recompose, as that library is so prevalent
I took a cursory glance at the documentation and came up with this graph:
emoji
meaning
✅
covered
🚧
feasible, not implemented yet
🤔
need to think on it
😧
😧
hoc
explanation
✅
mapProps()
this is just cc.map(a => b)
✅
withProps()
this is just CC.of({})
🤔
withPropsOnChange()
🤔
withHandlers()
✅
defaultProps()
is just CC.of({})
✅
renameProp()
is just cc.map(a => b)
✅
renameProps()
is just cc.map(a => b)
✅
flattenProp()
is just cc.map(a => b)
✅
withState()
🤔
withStateHandlers()
🚧
withReducer()
✅
branch()
is just fork()
✅
renderComponent()
is just fork(true ), maybe could add a special case?
✅
renderNothing()
is just fork(true, () => null
🚧
shouldUpdate()
✅
pure()
is just pure() … not sure this is a good one to promote, though?
✅
onlyUpdateForKeys()
is just pure()
🤷♀️
onlyUpdateForPropTypes()
🚧
withContext()
🚧
getContext()
✅
lifecycle()
withLifecycle()
😧
toClass()
✅
toRenderProps()
✅
fromRenderProps()
For the "handlers" hocs, I think it makes the most sense to just implement something like the useCallback hook, and then they are just different mappings/combinations of that chainable.
The text was updated successfully, but these errors were encountered:
I'd like to have direct replacements for or at least an explanation of how one would emulate every hoc from recompose, as that library is so prevalent
I took a cursory glance at the documentation and came up with this graph:
For the "handlers" hocs, I think it makes the most sense to just implement something like the
useCallback
hook, and then they are just different mappings/combinations of that chainable.The text was updated successfully, but these errors were encountered: