pycodestyle icon indicating copy to clipboard operation
pycodestyle copied to clipboard

Swap of key and type in custom store

Open stephane opened this issue 2 years ago • 0 comments

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.

stephane avatar Sep 01 '23 11:09 stephane