An immutable key-value mapped context that can be passed to any (@link IAction}. All actors that receive a context must forward this context to any actor, mediator or bus that it calls. This context may be transformed before forwarding.

For type-safety, the keys of this context can only be instances of IActionContextKey, where each key supplies acceptable the value type.

Each bus should describe in its action interface which context entries are possible (non-restrictive) and corresponding context keys should be exposed in '@comunica/context-entries' for easy reuse. If actors support any specific context entries next to those inherited by the bus action interface, then this should be described in its README file.

This context can contain any information that might be relevant for certain actors. For instance, this context can contain a list of datasources over which operators should query.

interface IActionContext {
    delete: (<V>(key) => IActionContext);
    get: (<V>(key) => undefined | V);
    getSafe: (<V>(key) => V);
    has: (<V>(key) => boolean);
    keys: (() => IActionContextKey<any>[]);
    merge: ((...contexts) => IActionContext);
    set: (<V>(key, value) => IActionContext);
    setDefault: (<V>(key, value) => IActionContext);
    toJS: (() => any);
}

Implemented by

    Properties

    delete: (<V>(key) => IActionContext)

    Type declaration

    get: (<V>(key) => undefined | V)

    Type declaration

    getSafe: (<V>(key) => V)

    Type declaration

    has: (<V>(key) => boolean)

    Type declaration

    keys: (() => IActionContextKey<any>[])

    Type declaration

    merge: ((...contexts) => IActionContext)

    Type declaration

    set: (<V>(key, value) => IActionContext)

    Type declaration

    setDefault: (<V>(key, value) => IActionContext)

    Will only set the value if the key is not already set.

    Type declaration

    toJS: (() => any)

    Type declaration

      • (): any
      • Returns any