Adding More Options to useDependency Hook
Examine how to enhance the “useDependency” hook to cover more use cases.
Configuration for dependency object
In the previous lesson, the content was the only available option in the dependency object. Now, two new options are added here:
- The
strategystring tells the hook how to get the requested prop. Valid values can be likefetch,store,cacheetc. - The
storeobject can be provided with externalactionCreatorto call after prop fetch is successful.
{
content: 'user',
strategy: 'fetch',
store: ...