Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Helpers

Helpers

  • select<T>(store: T, map: ArrayMapping<T>): (<Q>(obj?: Q) => ArrayMappingResult<T> & Q)
  • select<T, P>(store: T, map: P): (<Q>(obj?: Q) => ObjectMappingResult<T, P> & Q)
  • Often time, only a few properties are needed to be watched by the component, and being reactive to the a large observable may causes performance impact. In this case, you can either write your own initializer to reduce the watched properties, or use select to save some hassle.

    Example:


    let { bastards: { Jon, Ramsay } } = useObservable(select(northFamilies, ['bastards']))
    // or equivalent
    let { northBastards: { Jon, Ramsay } } =
    useObservable(select(northFamilies, { bastards: 'northBastards' }))

    Type Parameters

    • T

    Parameters

    • store: T
    • map: ArrayMapping<T>

    Returns (<Q>(obj?: Q) => ArrayMappingResult<T> & Q)

      • <Q>(obj?: Q): ArrayMappingResult<T> & Q
      • Often time, only a few properties are needed to be watched by the component, and being reactive to the a large observable may causes performance impact. In this case, you can either write your own initializer to reduce the watched properties, or use select to save some hassle.

        Example:


        let { bastards: { Jon, Ramsay } } = useObservable(select(northFamilies, ['bastards']))
        // or equivalent
        let { northBastards: { Jon, Ramsay } } =
        useObservable(select(northFamilies, { bastards: 'northBastards' }))
        category

        Helpers

        Type Parameters

        Parameters

        • Optional obj: Q

        Returns ArrayMappingResult<T> & Q

  • Type Parameters

    • T

    • P extends ObjectMapping<T>

    Parameters

    • store: T
    • map: P

    Returns (<Q>(obj?: Q) => ObjectMappingResult<T, P> & Q)

      • <Q>(obj?: Q): ObjectMappingResult<T, P> & Q
      • Type Parameters

        Parameters

        • Optional obj: Q

        Returns ObjectMappingResult<T, P> & Q

Generated using TypeDoc