From 1236900ddfd07d19492f56ec0b005bb0d98efc53 Mon Sep 17 00:00:00 2001 From: Aria Minaei Date: Thu, 1 Dec 2022 14:54:10 +0100 Subject: [PATCH] Unify Derivation and Prism 10/n --- packages/dataverse/src/Box.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/dataverse/src/Box.ts b/packages/dataverse/src/Box.ts index a1f2839..5592c1d 100644 --- a/packages/dataverse/src/Box.ts +++ b/packages/dataverse/src/Box.ts @@ -33,12 +33,12 @@ export interface IBox { * Wraps a single value. * * @remarks - * Derivations created with {@link Box.prism} update based on strict equality (`===`) of the old value and the new one. + * Prisms created with {@link Box.prism} update based on strict equality (`===`) of the old value and the new one. * This also means that property-changes of objects won't be tracked, and that for objects, updates will trigger on changes of * reference even if the objects are structurally equal. */ export default class Box implements IBox { - private _publicDerivation: Prism + private _publicPrism: Prism private _emitter = new Emitter() /** @@ -53,7 +53,7 @@ export default class Box implements IBox { const subscribe = (listener: (val: V) => void) => this._emitter.tappable.tap(listener) const getValue = () => this._value - this._publicDerivation = prism(() => { + this._publicPrism = prism(() => { return prism.source(subscribe, getValue) }) } @@ -85,6 +85,6 @@ export default class Box implements IBox { * Returns a prism of the Box that you can use to track changes to it. */ get prism() { - return this._publicDerivation + return this._publicPrism } }