Class InRole<TValue>Abstract

A role of input control.

Contains arbitrary named roles. A special role 'default' considered active when no other roles activated.

Roles may be used to conditionally activate other input aspects of the control.

Type Parameters

  • TValue

    Input value type.

Hierarchy

  • InRole

Implements

Constructors

Properties

Accessors

Methods

Constructors

  • Type Parameters

    • TValue

    Returns InRole<TValue>

Properties

read: AfterEvent<[Active]>

An AfterEvent keeper of active roles.

The [AfterEvent__symbol] method returns this value.

Accessors

Methods

  • Adds named role to control.

    The named role becomes activate. To deactivate it the returned supply has to be cut off.

    The same role may be added multiple times. In that case the role will be deactivated once all role supplies cut off.

    Parameters

    • role: string

      A name of the role to add.

    Returns Supply

    A role supply. Removes the added role once cut off.

  • Registers an activator of the given role.

    The given activator would be issued once the given role activated. A supply instance returned by activator call will be cut off once the role deactivated.

    Parameters

    • role: string

      Target role name.

    • activator: Activator<TValue>

      Role activator.

    Returns Supply

    Activator supply. Removes the registered activator once cut off.

Generated using TypeDoc