Options
All
  • Public
  • Public/Protected
  • All
Menu

@obsidize/rx-map

Index

Type aliases

EntityTransform

EntityTransform<T>: (entity: T) => T

Type parameters

  • T

Type declaration

    • (entity: T): T
    • Parameters

      • entity: T

      Returns T

Predicate

Predicate<V>: (value: V) => boolean

Type parameters

  • V

Type declaration

    • (value: V): boolean
    • Parameters

      • value: V

      Returns boolean

PropertySelector

PropertySelector<K, V>: (value: V) => K

Type parameters

  • K

  • V

Type declaration

    • (value: V): K
    • Parameters

      • value: V

      Returns K

Functions

accumulateChanges

  • Emits change detection diffs between each emission and the one previous of it. NOTE: if the detection result type is NO_CHANGE, then the emission will be dropped.

    Type parameters

    • T

    Returns OperatorFunction<T, ChangeDetectionAccumulator<T>>

castArray

  • castArray<T>(v: any): T[]

deepDifferenceBetween

  • deepDifferenceBetween<T>(current: T, previous: T): Partial<T>
  • Type parameters

    • T

    Parameters

    • current: T
    • previous: T

    Returns Partial<T>

detectAccumulatedChanges

detectChanges

  • Evaluates changes between the two given values, and constructs a change detection event instance based on the evaluation output.

    The output in the "changes" object will consist of all the values that have changed when transitioning from 'baseObj' to 'obj', and the plucked values will match the ones in 'obj'.

    Type parameters

    • T

    Parameters

    • current: T
    • previous: T

    Returns ChangeDetectionResult<T>

extractChanges

  • Convenience for running change detection on a map state change event and storing the results in the event. This is implemented as an optional utility since change detection might not be necessary in some cases, and can be quite expensive to run.

    Type parameters

    • K

    • V

    Parameters

    Returns MapStateChangeEvent<K, V>

forKey

forKeyIn

isActionableChangeDetectionResultType

  • isActionableChangeDetectionResultType(value: any): boolean
  • Returns true if the given value is a valid detection type, except for the NO_CHANGE type. (i.e. any type that indicates state mutation has occurred)

    Parameters

    • value: any

    Returns boolean

ofType

pluckChanges

  • pluckChanges<T>(): OperatorFunction<{ changes?: T }, Partial<T>>
  • map change events to their corresponding entity update differences (will be a partial entity object)

    Type parameters

    • T

    Returns OperatorFunction<{ changes?: T }, Partial<T>>

pluckValue

  • pluckValue<T>(): OperatorFunction<{ value?: T }, T>
  • map change events to their corresponding entity value

    Type parameters

    • T

    Returns OperatorFunction<{ value?: T }, T>

pluckValueChanges

spreadFilterBy

  • spreadFilterBy<T, R>(values: T[], extractValue: (emission: R) => T): MonoTypeOperatorFunction<R>
  • Variant of filter() that uses a Set to increase lookup speed when checking emissions for a single property value. NOTE: this variant is top-heavy, and more expensive on smaller value lists; only use this when the 'values' collection can become large.

    Type parameters

    • T

    • R

    Parameters

    • values: T[]
    • extractValue: (emission: R) => T
        • (emission: R): T
        • Parameters

          • emission: R

          Returns T

    Returns MonoTypeOperatorFunction<R>

storeEntityArrayIn

  • storeEntityArrayIn<K, V>(entityMap: RxEntityMap<K, V>): MonoTypeOperatorFunction<V[]>
  • capture emitted values and store them in the provided map reference by side-effect

    Type parameters

    • K

    • V

    Parameters

    Returns MonoTypeOperatorFunction<V[]>

storeEntityIn

  • storeEntityIn<K, V>(entityMap: RxEntityMap<K, V>): MonoTypeOperatorFunction<V>
  • capture emitted values and store them in the provided map reference by side-effect

    Type parameters

    • K

    • V

    Parameters

    Returns MonoTypeOperatorFunction<V>

Generated using TypeDoc