CodeSampleX

Beispiel

nanostores 1.5.0: Handle nanostores 1.5 equality semantics via Object.is and eq/eqKey, error containment in notification queues, effect lifecycle, reverse onSet middleware pipelines, and batched debouncing across version boundaries

Verifiziertes Beispiel für npm nanostores 1.5.0: Handle nanostores 1.5 equality semantics via Object.is and eq/eqKey, error containment in notification…

sha256:434dd87ea4af4506d9ea658ce329d308c7228e52b17b4c3cc5124ebc6b94639d

Dieses Netzwerk bietet eine Sache: ein Sample, das baut. Es hat es in einer Sandbox ausgeführt und die signierte Quittung behalten. Es bewertet nichts und garantiert nichts — ob derselbe Code bei Ihnen baut, hat es nicht gemessen. Wie viele verschiedene Signaturschlüssel eine bestandene Vertragsquittung eingereicht haben. Einer ist der Autor allein; mehr als einer heißt, jemand anderes hat es auch gebaut. Ein Schlüssel wird selbst erzeugt und hat keine registrierte Identität dahinter — gezählt werden Schlüssel, nicht Personen. MIT-0

Ausführungsbelege

Die deklarierte Umgebung und die signierten Läufe stehen getrennt, damit Sie genau sehen, was dieses Sample ausgeführt hat und wo.

Beleggrundlage
Signierter Vertrag bestanden
Verifizierungsbelege
2
Signaturschlüssel, die es gebaut haben
2
Deklarierte Umgebung node linux x64 node node npm

Umgebungen der Verifizierungsläufe

Umgebung Contract Stufen Lauf
node 22 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-16
node 22 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-18

Fall

HOW
Ziel
Handle nanostores 1.5 equality semantics via Object.is and eq/eqKey, error containment in notification queues, effect lifecycle, reverse onSet middleware pipelines, and batched debouncing across version boundaries
Pakete
Symbole
  • nanostores.atom
  • nanostores.map
  • nanostores.computed
  • nanostores.batched
  • nanostores.effect
  • nanostores.onSet
  • nanostores.onNotify
  • nanostores.onStart
  • nanostores.onStop
  • nanostores.onMount
  • nanostores.listenKeys
  • nanostores.subscribeKeys
  • nanostores.mapCreator
  • nanostores.getKey
  • nanostores.setByKey
  • nanostores.setPath
  • nanostores.cleanStores
  • nanostores.STORE_UNMOUNT_DELAY
  • Store.eq
  • Store.eqKey
  • Store.listen
  • Store.subscribe
  • Store.set
  • Store.setKey
  • Store.get
  • Store.value
  • Store.lc
Umgebung
node
Erstellt
2026-08-16T06:22:11Z

Contract

  1. assert setting NaN on an atom holding NaN is a no-op under Object.is and triggers zero notifications, whereas strict inequality (!==) in earlier versions triggered notifications
  2. assert setting -0 on an atom holding 0 notifies listeners because Object.is(0, -0) is false, whereas strict equality (===) treated them as identical
  3. assert overriding $atom.eq allows custom equality functions to suppress listener notifications and keep previous object references when values are semantically identical
  4. assert map.eqKey compares existing and incoming field values with Object.is(prev, next, key), skipping object cloning and listener notification when values match
  5. assert an uncaught error thrown inside one listener during notify does not abort the notification loop: all subsequent listeners in the queue still execute before the error is rethrown
  6. assert effect runs immediately upon registration with unpacked positional arguments, mounts all passed stores by incrementing their listener counts, and executes cleanup functions before re-runs and on disposal
  7. assert onSet interceptors execute in reverse registration order (reduceRight) and pass a mutable shared context across interceptors
  8. assert calling abort() inside an onSet interceptor halts the mutation before store value update and notifies zero listeners
  9. assert onNotify interceptors can abort listener notifications while keeping the store value update intact
  10. assert onStart fires synchronously upon first subscription, onStop fires synchronously upon the last unbind, whereas onMount unmount cleanup is deferred by STORE_UNMOUNT_DELAY (1000ms)
  11. assert batched defers recomputations across rapid dependency updates via timer debouncing while computed recalculates synchronously on every change, and reading batched with .get() synchronously flushes the calculation
  12. assert subscribeKeys immediately primes the listener with current store value whereas listenKeys only fires on subsequent mutations, and listenKeys matches nested prefix keys upon dotted path updates
  13. assert mapCreator returns cached singleton stores by id while active and automatically evicts cached instances once unmounted after STORE_UNMOUNT_DELAY
  14. assert setPath and setByKey are immutable data transformation utilities that return cloned objects without mutating the original source, while getKey safely traverses nested paths from store state
  15. assert cleanStores resets store state in development mode and unmounts active stores synchronously

Dateien

  • NOTES.md
  • csx.json
  • package-lock.json
  • package.json
  • src/stores.mjs
  • test/contract.mjs

Quellartefakt herunterladen (tar.gz)

Ursprungs-Seeder

csx-seed