Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap of key and type in custom store #470

Open
stephane opened this issue Sep 1, 2023 · 0 comments
Open

Swap of key and type in custom store #470

stephane opened this issue Sep 1, 2023 · 0 comments

Comments

@stephane
Copy link

stephane commented Sep 1, 2023

I was surprised by the inversion of type and key in custom store of Svelvet.
We have many TS types such as:

  • Map<CustomEdgeKey, WritableEdge>
  • Record<string, Writable<unknown> | Readable<unknown>>

but the Svelvet's Store interface is defined in the opposite way export interface Store<T, K>.
IMHO it generates disturbing usage and definitions such as:

export interface Store<T, K> {
	subscribe: Writable<Map<K, T>>['subscribe'];
        ...

where T, V is swapped to K, V.

I propose to use common K, V ordering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant