RxJS Integration for GunDB Provides reactive programming capabilities for GunDB data

Constructors

  • Initialize GunRxJS with a GunDB instance

    Parameters

    • gun: IGunInstance<any>

      GunDB instance

    Returns GunRxJS

Properties

gun: IGunInstance<any>
user: IGunUserInstance<any>

Methods

  • Compute derived values from gun 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 IGunUserInstance<any>

    The current user

  • Get the current user's public key

    Returns undefined | string

    The current user's public key

  • Match data based on Gun's '.map()' and convert to Observable

    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 Gun node for changes

    Type Parameters

    • T

    Parameters

    • path: any

      Path to observe (can be a string or a Gun chain)

    Returns Observable<T>

    Observable that emits whenever the node changes

  • Observe user data

    Type Parameters

    • T

    Parameters

    • path: 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

    • path: 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

    • data: T

      Data to put

    Returns Observable<T>

    Observable that completes when the put is acknowledged

  • Remove Gun metadata from an object

    Type Parameters

    • T

    Parameters

    • obj: T

      Object to clean

    Returns T

    Cleaned object without Gun metadata

  • Set data on a node and return an Observable

    Type Parameters

    • T

    Parameters

    • path: any

      Path to the collection

    • data: T

      Data to set

    Returns Observable<T>

    Observable that completes when the set is acknowledged

  • 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

    Parameters

    • path: string

      Path where to put the data

    • data: T

      Data to put

    Returns Observable<T>

    Observable that completes when the put is acknowledged