Skip to content

Create hooks creator "makeUseMulti" #87

Open
@eric-burel

Description

@eric-burel

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.

Of course, do the same for other hooks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions