Skip to content

reactive/bindable **Iterable** data structure #65

@DrSensor

Description

@DrSensor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    data bindingEverything related to data bindingoptimizationBecause speed, memory consumption, and bundle size are important

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions