Open DrSensor opened 1 year ago
Also, supporting plain Object as Dictionary might be a good idea since it get optimized as long as the keys < 32. Although Map is superior than plain Object, plain Object get optimized most of the time.
export class Dictionary<T extends Record<infer K, infer V>> implements Map<K, V> {
#data: T
constructor(data: T = {}) {
this.#data = data
}
}
The more I think about making reactive ES data type, the more it give me a headache when I want to make the memory contiguous 😅
Alright, I should start with Arrow data type first then map it 1:1 into ES data type.
This replace/shim JS Array, Map, and Set with
nusa/std
Vector, Map, Set.Yes, indexing operator (i.e
arr[i]
) is not reactive and there is no way to override/overload it in JS. That's why the name is Vector, not Array.