-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Description
What problem does this feature solve?
The getters
key of the Store instance has type any
which is not useful. While type casting can be used, it's just a pain to have to do every single place you would want to reference a getter.
What does the proposed API look like?
One solution would be to offer a second (optional) generic type of the Store
type that would default to any
, and have that value be used for the type of the getters
key.
export declare class Store<S, G = any> {
constructor(options: StoreOptions<S>);
readonly state: S;
readonly getters: G;
...
}
I've tested the above solution and it works and should also be backwards compatible.
Metadata
Metadata
Assignees
Labels
No labels