This replace/shim JS Array, Map, and Set with nusa/std Vector, Map, Set.
import { Vector as Vec, Map, Set } from "//esm.run/nusa/std/collections"
export default {
coins = new Vec<number>()
makets = new Map<string, number>()
symbols = new Set<string>()
shuffleLastCoin() {
console.debug("previous last coin", this.coins.at(-1))
this.coins.setAt(-1, dice([100, 300], [10, 50]))
}
}
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.
This replace/shim JS Array, Map, and Set with
nusa/stdVector, 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.