Very good post.
One problem and one improvement
Factory class, you did Factory.getUser but getUser is not static, or you don't create factory via "new".
you could use useCallback instead in the Shared state example at "memoize the function"
Thanks for catching this! I've updated the examples.
The interesting thing is that useCallback or useMemo is not actually needed.
useCallback
useMemo
One more catch - useUppercasedString listed twice, instead of useLowercasedString the second time.
useUppercasedString
useLowercasedString
Fixed :D
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Very good post.
One problem and one improvement
Factory class, you did Factory.getUser but getUser is not static, or you don't create factory via "new".
you could use useCallback instead in the Shared state example at "memoize the function"
Thanks for catching this! I've updated the examples.
The interesting thing is that
useCallback
oruseMemo
is not actually needed.One more catch -
useUppercasedString
listed twice, instead ofuseLowercasedString
the second time.Fixed :D