RxJS Integration for Holster Provides reactive programming capabilities for Holster data

Constructors

  • Initialize RxJSHolster with a Holster instance

    Parameters

    • holsterInstance: any

    Returns RxJSHolster

Properties

holster: any
user: any

Methods

  • Compute derived values from holster data

    Type Parameters

    • T
    • R

    Parameters

    • sources: (string | Observable<any>)[]

      Array of paths or observables to compute from

    • computeFn: (...values: T[]) => R

      Function that computes a new value from the sources

    Returns Observable<R>

    Observable of computed values

  • Get the current user

    Returns any

    The current user

  • Get the current user's public key

    Returns undefined | string

    The current user's public key

  • Match data based on Holster collections and convert to Observable Note: Holster doesn't have .map(), so we implement it using .on()

    Type Parameters

    • T

    Parameters

    • path: any

      Path to the collection

    • OptionalmatchFn: (data: any) => boolean

      Optional function to filter results

    Returns Observable<T[]>

    Observable array of matched items

  • Observe a Holster node for changes Uses Holster's .get().next() API instead of chained .get()

    Type Parameters

    • T

    Parameters

    • path: any

      Path to observe (can be a string, array, or a Holster chain)

    Returns Observable<T>

    Observable that emits whenever the node changes

  • Observe user data

    Type Parameters

    • T

    Parameters

    • Optionalpath: string

      Path to observe in user space

    Returns Observable<T>

    Observable that emits whenever the user data changes

  • Get data once and return as Observable

    Type Parameters

    • T

    Parameters

    • Optionalpath: any

      Path to get data from

    Returns Observable<T>

    Observable that emits the data once

  • Put data and return an Observable

    Type Parameters

    • T

    Parameters

    • path: any

      Path where to put the data

    • Optionaldata: T

      Data to put

    Returns Observable<T>

    Observable that completes when the put is acknowledged

  • Remove Holster-specific metadata from data objects

    Type Parameters

    • T

    Parameters

    • obj: T

      Object to clean

    Returns T

    Cleaned object without Holster metadata

  • Get user data

    Type Parameters

    • T

    Parameters

    • path: string

      Path to get data from

    Returns Observable<T>

    Observable that emits the data once

  • User put data and return an Observable (for authenticated users)

    Type Parameters

    • T extends Partial<any> & Record<string, any>

    Parameters

    • dataOrPath: string | T
    • OptionalmaybeData: T
    • Optionalcallback: (ack: any) => void

    Returns Observable<T>

    Observable that completes when the put is acknowledged