Class CxPeerBuilder<TContext>

Context peer builder.

Allows to specify value assets preceding those from context builder.

In contrast to context builder this one does not build any context. It is an error accessing it.

Type Parameters

  • TContext extends CxValues = CxValues

    Context type the assets provided for.

Hierarchy

Implements

  • CxModifier<TContext>
  • CxPeer<TContext>

Constructors

  • Constructs context peer builder.

    Type Parameters

    • TContext extends CxValues = CxValues

    Parameters

    • Rest ...peers: CxPeer<TContext>[]

      Context peers to apply assets from. These assets applied before the ones provided

    Returns CxPeerBuilder<TContext>

Properties

_peers: readonly CxPeer<TContext>[]
_rankCount: number = 0
_records: Map<CxEntry<any, any>, CxEntry$Record<any, any, TContext>> = ...
_supply: Supply = ...

Accessors

  • get context(): TContext
  • Returns TContext

  • get rankCount(): number
  • The number of CxAsset.Provided.rank asset ranks this peer contains.

    Returns number

  • get supply(): Supply
  • Context peer supply.

    Revokes all assets provided by this peer once cut off.

    Returns Supply

Methods

  • Internal

    Type Parameters

    • TValue

    • TAsset

    Parameters

    • entry: CxEntry<TValue, TAsset>

    Returns CxEntry$Record<TValue, TAsset, TContext>

  • Iterates over particular entry assets in the same order they are provided.

    Each asset reported to the given callback function until the latter returns false or there are no more assets.

    Type Parameters

    • TValue

    • TAsset

    Parameters

    • target: Target<TValue, TAsset, TContext>

      Context entry definition target to iterate over assets of.

    • cache: Cache

      Target context cache.

    • callback: Callback<TAsset>

      Assets callback.

    Returns void

  • Iterates over particular entry assets with the most recent assets iterated first. I.e. in reverse order to the order they are provided.

    Each asset reported to the given callback function until the latter returns false or there are no more assets.

    Type Parameters

    • TValue

    • TAsset

    Parameters

    • target: Target<TValue, TAsset, TContext>

      Context entry definition target to iterate over assets of.

    • cache: Cache

      Target context cache.

    • callback: Callback<TAsset>

      Assets callback.

    Returns void

  • Type Parameters

    • TValue

    • TAsset = TValue

    Parameters

    • asset: CxAsset<TValue, TAsset, TContext>

    Returns Supply

  • Reads assets of particular entry value and start tracking of their additions.

    Type Parameters

    • TValue

    • TAsset

    Parameters

    • target: Target<TValue, TAsset, TContext>

      Context entry definition target to track assets for.

    • cache: Cache

      Target context cache.

    • receiver: Receiver<TAsset>

      A receiver to report existing and added assets to.

    • Optional tracking: CxTracking

      Tracking options.

    Returns Supply

    Assets supply. Stops assets tracking once cut off.

Generated using TypeDoc