Skip to content

Add useStoreModule #1695

Open
Open
@h311x

Description

@h311x

What problem does this feature solve?

While I was looking through the examples of the 4.0 alpha version, I thought that when you have a large store it can become a bit annoying to declare getters and actions locally in every component you need. So I think it would be nice to have a some sort of a helper function that returns only (hopefully typed) store module you want to use.

What does the proposed API look like?

const myModule = useStoreModule("module namespace")

console.log(myModule.state) // returns state of a module etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions