Function cxTrackAsset

  • Creates context entry asset that tracks for value asset updates.

    Starts tracking at most once per context.

    Type Parameters

    • TValue

      Context value type.

    • TAsset = TValue

      Context value asset type.

    • TContext extends CxValues = CxValues

      Supported context type.

    Parameters

    • entry: CxEntry<TValue, TAsset>

      Target context entry.

    • track: ((this, target, receiver, supply) => void)

      Starts assets tracking. Accepts context entry definition target, assets receiver function, and assets supply as parameters. Passes updated assets to receiver until supply cut off.

        • (this, target, receiver, supply): void
        • Parameters

          • this: void
          • target: Target<TValue, TAsset, TContext>
          • receiver: ((this, ...assets) => void)
              • (this, ...assets): void
              • Parameters

                • this: void
                • Rest ...assets: TAsset[]

                Returns void

          • supply: Supply

          Returns void

    • supply: Supply = ...

      Asset supply. Removes the created asset once cut off.

    Returns CxAsset<TValue, TAsset, TContext>

    New context entry asset.

Generated using TypeDoc