Open eric-burel opened 2 years ago
Is your feature request related to a problem? Please describe.
When creating a model, you might want to expose reusable hooks with default options:
const useMultiTweets = () => useMulti({model: Tweets})
It is difficult to write such a closure however, because of the parameters structure.
Describe the solution you'd like
const useMultiTweets = makeUseMulti<TweetType>({model: Tweets})
In this example, makeUseMulti handles the merge of paremeters, so that useMultiTweets has the exact same APi as useMulti, but uses Tweets as the default model.
makeUseMulti
useMultiTweets
useMulti
Of course, do the same for other hooks.
Is your feature request related to a problem? Please describe.
When creating a model, you might want to expose reusable hooks with default options:
It is difficult to write such a closure however, because of the parameters structure.
Describe the solution you'd like
In this example,
makeUseMulti
handles the merge of paremeters, so thatuseMultiTweets
has the exact same APi asuseMulti
, but uses Tweets as the default model.Of course, do the same for other hooks.