Derived

类: Derived<TState, TArr>

定义于: derived.ts:54

类型参数

TState

TArr extends ReadonlyArray<Derived<any> | Store<any>> = ReadonlyArray<any>

构造函数

new Derived()

ts
new Derived<TState, TArr>(options): Derived<TState, TArr>
new Derived<TState, TArr>(options): Derived<TState, TArr>

定义于: derived.ts:87

参数

options

DerivedOptions<TState, TArr>

返回值

Derived<TState, TArr>

属性

lastSeenDepValues

ts
lastSeenDepValues: unknown[] = [];
lastSeenDepValues: unknown[] = [];

定义于: derived.ts:71


listeners

ts
listeners: Set<Listener<TState>>;
listeners: Set<Listener<TState>>;

定义于: derived.ts:60


options

ts
options: DerivedOptions<TState, TArr>;
options: DerivedOptions<TState, TArr>;

定义于: derived.ts:63


prevState

ts
prevState: undefined | TState;
prevState: undefined | TState;

定义于: derived.ts:62


state

ts
state: TState;
state: TState;

定义于: derived.ts:61

方法

checkIfRecalculationNeededDeeply()

ts
checkIfRecalculationNeededDeeply(): void
checkIfRecalculationNeededDeeply(): void

定义于: derived.ts:157

返回值

void


getDepVals()

ts
getDepVals(): object
getDepVals(): object

定义于: derived.ts:72

返回值

object

currDepVals
ts
currDepVals: unknown[];
currDepVals: unknown[];
prevDepVals
ts
prevDepVals: unknown[];
prevDepVals: unknown[];
prevVal
ts
prevVal: undefined | NonNullable<TState>;
prevVal: undefined | NonNullable<TState>;

mount()

ts
mount(): () => void
mount(): () => void

定义于: derived.ts:178

返回值

Function

返回值

void


recompute()

ts
recompute(): void
recompute(): void

定义于: derived.ts:145

返回值

void


registerOnGraph()

ts
registerOnGraph(deps): void
registerOnGraph(deps): void

定义于: derived.ts:96

参数

deps

readonly ( | Derived<any, readonly any[]> | Store<any, (cb) => any>)[] = ...

返回值

void


subscribe()

ts
subscribe(listener): () => void
subscribe(listener): () => void

定义于: derived.ts:190

参数

listener

Listener<TState>

返回值

Function

返回值

void


unregisterFromGraph()

ts
unregisterFromGraph(deps): void
unregisterFromGraph(deps): void

定义于: derived.ts:125

参数

deps

readonly ( | Derived<any, readonly any[]> | Store<any, (cb) => any>)[] = ...

返回值

void

订阅 Bytes

您的每周 JavaScript 新闻。每周一免费发送给超过 10 万名开发者。

Bytes

无垃圾邮件。随时取消订阅。