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 } }