From 918dd754a70ee7a1cbd4a397da71e3bb7453ce1d Mon Sep 17 00:00:00 2001 From: Aria Minaei Date: Mon, 28 Nov 2022 14:31:58 +0100 Subject: [PATCH] Retire `ConstantDerivation` --- .../src/derivations/ConstantDerivation.ts | 29 ------------------- packages/dataverse/src/index.ts | 1 - 2 files changed, 30 deletions(-) delete mode 100644 packages/dataverse/src/derivations/ConstantDerivation.ts diff --git a/packages/dataverse/src/derivations/ConstantDerivation.ts b/packages/dataverse/src/derivations/ConstantDerivation.ts deleted file mode 100644 index 8d37a5a..0000000 --- a/packages/dataverse/src/derivations/ConstantDerivation.ts +++ /dev/null @@ -1,29 +0,0 @@ -import AbstractDerivation from './AbstractDerivation' - -/** - * A derivation whose value never changes. - */ -export default class ConstantDerivation extends AbstractDerivation { - private readonly _v: V - - /** - * @param v - The value of the derivation. - */ - constructor(v: V) { - super() - this._v = v - return this - } - - /** - * @internal - */ - _recalculate() { - return this._v - } - - /** - * @internal - */ - _reactToDependencyBecomingStale() {} -} diff --git a/packages/dataverse/src/index.ts b/packages/dataverse/src/index.ts index 383a638..bdadf9b 100644 --- a/packages/dataverse/src/index.ts +++ b/packages/dataverse/src/index.ts @@ -9,7 +9,6 @@ export {default as Atom, val, valueDerivation} from './Atom' export {default as Box} from './Box' export type {IBox} from './Box' export {default as AbstractDerivation} from './derivations/AbstractDerivation' -export {default as ConstantDerivation} from './derivations/ConstantDerivation' export {default as DerivationFromSource} from './derivations/DerivationFromSource' export {isDerivation} from './derivations/IDerivation' export type {IDerivation} from './derivations/IDerivation'