Options
Menu

ActiveJS

Enumerations

1. Units Classes

2. Abstract Classes

3. Systems Classes

4. Utility Classes

Action Interfaces

Cluster Interfaces

Common Interfaces

Global Config Interfaces

Other Interfaces

Systems Interfaces

Units Interfaces

Action/Units Type aliases

Cluster Type aliases

Global Config Type aliases

Systems Type aliases

Units Type aliases

Common Events

Common Units Events

DictUnit Events

ListUnit Events

Global Functions

Action/Units Type aliases

DispatchValueProducer

DispatchValueProducer<T>: (value: T) => T

Type for value producer function that is passed to an Action or Unit's dispatch method.

Type parameters

  • T

Type declaration

    • (value: T): T
    • Parameters

      • value: T

      Returns T

Cluster Type aliases

ClusterItems

ClusterItems: {}

Type of dictionary object that a Cluster accepts.

Type declaration

Global Config Type aliases

GlobalActionConfig

GlobalActionConfig: SharedActionConfig

Shared global config options for Actions.

GlobalClusterConfig

GlobalClusterConfig: SharedClusterConfig

Shared global config options for Clusters.

GlobalUnitConfig

GlobalUnitConfig<T>: SharedUnitConfig<T>

Shared global config options for Units.

Type parameters

  • T

Systems Type aliases

AsyncSystemStreamObservableProducer

AsyncSystemStreamObservableProducer<QueryUnit, DataUnit, ErrorUnit, R>: (queryUnit: QueryUnit, dataUnit: DataUnit, errorUnit: ErrorUnit, pendingUnit: BoolUnit) => Observable<R>

A function that receives upto four Units that are part of an AsyncSystem.

param

The Unit being used as queryUnit in the AsyncSystem.

param

The Unit being used as dictUnit in the AsyncSystem.

param

The Unit being used as errorUnit in the AsyncSystem.

param

The Unit being used as pendingUnit in the AsyncSystem.

returns

An Observable.

Type parameters

Type declaration

    • (queryUnit: QueryUnit, dataUnit: DataUnit, errorUnit: ErrorUnit, pendingUnit: BoolUnit): Observable<R>
    • Parameters

      • queryUnit: QueryUnit
      • dataUnit: DataUnit
      • errorUnit: ErrorUnit
      • pendingUnit: BoolUnit

      Returns Observable<R>

Units Type aliases

ActionStreamObservableProducer

ActionStreamObservableProducer<T, R>: (action: T) => Observable<R>
param

The Action being used as the source observable for creating a new Observable.

Type parameters

Type declaration

    • (action: T): Observable<R>
    • Parameters

      • action: T

      Returns Observable<R>

ClusterStreamObservableProducer

ClusterStreamObservableProducer<T, R>: (cluster: T) => Observable<R>
param

The Action being used as the source observable for creating a new Observable.

Type parameters

Type declaration

    • (cluster: T): Observable<R>
    • Parameters

      • cluster: T

      Returns Observable<R>

DictValue

DictValue<T, K>: Record<K, T[K]>

Type of DictUnit's value, a dictionary object.

Type parameters

  • T

  • K: keyof T

Unit

Unit: BoolUnit | StringUnit | NumUnit | ListUnit<any> | DictUnit<any> | GenericUnit<any>

Union type of all the Units.

UnitStreamObservableProducer

UnitStreamObservableProducer<T, R>: (unit: T) => Observable<R>
param

The Unit being used as the source observable for creating a new Observable.

Type parameters

  • T

  • R

Type declaration

    • (unit: T): Observable<R>
    • Parameters

      • unit: T

      Returns Observable<R>

Common Events

BaseEvents

BaseEvents<T>: EventReplay<T>

The common events that every fundamental ActiveJS construct (Units, Systems, Action and Cluster) emits.

Type parameters

  • T

EventReplay

EventReplay<T>:

An event that gets emitted on successful replay by using the replay method.

Type parameters

  • T

constructor

value

value: T

The current value that got replayed.

Common Units Events

EventUnitClear

EventUnitClear:

An event that gets emitted on successful execution of Units' clear method.

constructor

Optional options

The options that were passed for the implicitly called clearCache method.

EventUnitClearCache

EventUnitClearCache:

An event that gets emitted on successful execution of Units' clearCache method.

constructor

Optional options

The options that were directly or indirectly passed to the clearCache method.

EventUnitClearPersistedValue

EventUnitClearPersistedValue:

An event that gets emitted on successful execution of Units' clearPersistentValue method.

EventUnitClearValue

EventUnitClearValue:

An event that gets emitted on successful execution of Units' clearValue method.

EventUnitDispatch

EventUnitDispatch<T>:

An event that gets emitted on successful dispatch by using the Units' dispatch method.

Type parameters

  • T

constructor

Optional options

The options that were passed to the dispatch method.

value

value: T

The value that was passed to the dispatch method.

EventUnitDispatchFail

EventUnitDispatchFail<T>:

An event that gets emitted on failed dispatch using the Units' dispatch method.

Type parameters

  • T

constructor

Optional options

The options that were passed to the dispatch method.

reason

The reason for why the dispatch failed.

value

value: T

The value that was passed to the dispatch method.

EventUnitFreeze

EventUnitFreeze:

An event that gets emitted when a Unit gets frozen.

EventUnitJump

EventUnitJump:

An event that gets emitted on successful cache-navigation, using the Units' several cache-navigation methods like goBack, goForward, jump, etc.

constructor

  • new EventUnitJump(steps: number, newCacheIndex: number): EventUnitJump
  • Parameters

    • steps: number

      The number of steps jumped represented as a number, positive for forward navigation and negative for backwards.

    • newCacheIndex: number

      The new cacheIndex of the emitted value.

    Returns EventUnitJump

newCacheIndex

newCacheIndex: number

The new cacheIndex of the emitted value.

steps

steps: number

The number of steps jumped represented as a number, positive for forward navigation and negative for backwards.

EventUnitReset

EventUnitReset:

An event that gets emitted on successful execution of Units' reset method.

constructor

Optional options

The options that were passed for the implicitly called clearCache method.

EventUnitResetValue

EventUnitResetValue:

An event that gets emitted on successful execution of Units' resetValue method.

EventUnitUnfreeze

EventUnitUnfreeze:

An event that gets emitted when a Unit gets unfrozen after being frozen.

EventUnitUnmute

EventUnitUnmute:

An event that gets emitted on successful unmute using the Units' unmute method.

UnitEvents

The common events that are emitted by all the Units.

Type parameters

  • T

DictUnit Events

DictUnitEvents

DictUnitEvents<T, K, V>: UnitEvents<T> | EventDictUnitSet<K, V> | EventDictUnitDelete<T> | EventDictUnitAssign<T>

The events that are triggered by a DictUnit.

Type parameters

EventDictUnitAssign

EventDictUnitAssign<T>:

An event that gets emitted on successful execution of DictUnit's assign method.

Type parameters

  • T

constructor

newProps

newProps: T

The new properties that finally got added to the DictUnit's value.

sources

sources: T[]

The source objects that were passed to the assign method.

EventDictUnitDelete

EventDictUnitDelete<T>:

An event that gets emitted on successful execution of DictUnit's delete or deleteIf method.

Type parameters

  • T

constructor

deletedProps

deletedProps: T

The properties that were deleted by the delete or deleteIf method.

EventDictUnitSet

EventDictUnitSet<K, V>:

An event that gets emitted on successful execution of DictUnit's set method.

Type parameters

  • K

  • V

constructor

key

key: K

The name of the property that was passed to the set method.

value

value: V

The value of the property that was passed to the set method.

ListUnit Events

EventListUnitCopyWithin

EventListUnitCopyWithin<Item>:

An event that gets emitted on successful execution of ListUnit's copyWithin method.

Type parameters

  • Item

constructor

Optional end

end: number

The ending position of the copied section.

start

start: number

The starting position of the copied section.

target

target: number

The target position from where the copied section starts replacing.

EventListUnitDelete

EventListUnitDelete<Item>:

An event that gets emitted on successful execution of ListUnit's delete or deleteIf method.

Type parameters

  • Item

constructor

deletedItems

deletedItems: Item[]

The items that got deleted from the ListUnit's value.

indices

indices: number[]

The indices that were passed to the delete method explicitly, or implicitly by deleteIf method.

EventListUnitFill

EventListUnitFill<Item>:

An event that gets emitted on successful execution of ListUnit's fill method.

Type parameters

  • Item

constructor

  • Parameters

    • item: Item

      The item that was passed to the fill method.

    • Optional start: number

      The starting position where the filling started.

    • Optional end: number

      The last position where the filling stopped.

    Returns EventListUnitFill

Optional end

end: number

The last position where the filling stopped.

item

item: Item

The item that was passed to the fill method.

Optional start

start: number

The starting position where the filling started.

EventListUnitPop

EventListUnitPop<Item>:

An event that gets emitted on successful execution of ListUnit's pop method.

Type parameters

  • Item

constructor

item

item: Item

The item that got popped from the ListUnit's value.

EventListUnitPush

EventListUnitPush<Item>:

An event that gets emitted on successful execution of ListUnit's push method.

Type parameters

  • Item

constructor

items

items: Item[]

The items that were passed to the push method.

EventListUnitRemove

EventListUnitRemove<Item>:

An event that gets emitted on successful execution of ListUnit's remove or removeIf method.

Type parameters

  • Item

constructor

indices

indices: number[]

The indices that were passed to the remove method explicitly, or implicitly by removeIf method.

removedItems

removedItems: Item[]

The items that got removed from the ListUnit's value.

EventListUnitReverse

EventListUnitReverse:

An event that gets emitted on successful execution of ListUnit's reverse method.

EventListUnitSet

EventListUnitSet<Item>:

An event that gets emitted on successful execution of ListUnit's set method.

Type parameters

  • Item

constructor

index

index: number

The index for the item passed to the set method.

item

item: Item

The item passed to the set method.

EventListUnitShift

EventListUnitShift<Item>:

An event that gets emitted on successful execution of ListUnit's shift method.

Type parameters

  • Item

constructor

item

item: Item

The item that got shifted out.

EventListUnitSort

EventListUnitSort:

An event that gets emitted on successful execution of ListUnit's sort method.

EventListUnitSplice

EventListUnitSplice<Item>:

An event that gets emitted on successful execution of ListUnit's splice or insert method.

Type parameters

  • Item

constructor

  • new EventListUnitSplice(start: number, deleteCount: number, removedItems: Item[], addedItems: Item[]): EventListUnitSplice
  • Parameters

    • start: number

      The zero-based location that was passed to the splice method.

    • deleteCount: number

      The number of items that were to be removed.

    • removedItems: Item[]

      The items that got removed.

    • addedItems: Item[]

      The items that were passed as items to be added.

    Returns EventListUnitSplice

addedItems

addedItems: Item[]

The items that were passed as items to be added.

deleteCount

deleteCount: number

The number of items that were to be removed.

removedItems

removedItems: Item[]

The items that got removed.

start

start: number

The zero-based location that was passed to the splice method.

EventListUnitUnshift

EventListUnitUnshift<Item>:

An event that gets emitted on successful execution of ListUnit's unshift method.

Type parameters

  • Item

constructor

items

items: Item[]

The items that were passed to the unshift method.

ListUnitEvents

The events that are emitted by a ListUnit.

Type parameters

  • Item

Global Functions

clearPersistentStorage

  • clearPersistentStorage(storage?: Storage): void
  • To clear persisted values of persistent Units from storage.

    Note: It does not clear the value of Units, only the persisted value is cleared.

    See https://docs.activejs.dev/guides/persistence for more details.

    Parameters

    • Default value storage: Storage = Configuration.storage

      The Storage from where the Units' persisted values need to be removed.
      Configuration.storage is used as storage by default.
      You can pass a reference to whichever storage you want to clean up.

    Returns void

deepCopy

  • deepCopy<T>(o: T): T
  • Creates a clone of the provided value.
    All the primitives are returned as is, since they are immutable.
    Non-primitives that this function can clone are array and object-literal.
    Other non-primitives are returned as is.

    This function is also used internally by ActiveJS.

    Type parameters

    • T

    Parameters

    • o: T

      The value to be cloned.

    Returns T

    A clone of the provided value.