Interface BaseUpdateBinder

The base interface for building bindings based on non-trivial user interactions (eg DnD) with routines for defining the UI command and the user interaction to use.

interface BaseUpdateBinder {
    catch(fn): BaseUpdateBinder;
    configureRules(ruleName, severity): BaseUpdateBinder;
    continuousExecution(): BaseUpdateBinder;
    end(fn): BaseUpdateBinder;
    log(...level): BaseUpdateBinder;
    name(name): BaseUpdateBinder;
    on<W>(widget, ...widgets): BaseUpdateBinder;
    onDynamic(node): BaseUpdateBinder;
    preventDefault(): BaseUpdateBinder;
    stopImmediatePropagation(): BaseUpdateBinder;
    throttle(timeout): BaseUpdateBinder;
    toProduce<C>(fn): CmdUpdateBinder<C>;
    toProduceAnon(fn): CmdUpdateBinder<Command>;
    usingInteraction<I, A, D>(fn): InteractionUpdateBinder<I, A, D>;
    when(fn, mode?): BaseUpdateBinder;
}

Hierarchy

Methods

  • Allows the processing of errors during the execution of the binding. Errors reported here are errors thrown in arrow functions provided to the the different routines of the binder and errors triggered by the command. A binder can have several cummulative 'catch' routines.

    Parameters

    • fn: ((ex) => void)

      The function to process the error caught by the binding during its execution

        • (ex): void
        • Parameters

          • ex: unknown

          Returns void

    Returns BaseUpdateBinder

    A clone of the current binder to chain the building configuration.

  • Specifies the widgets on which the binding will operate. When a widget is added to this list, this widget is binded to this binding. When widget is removed from this list, this widget is unbinded from this binding.

    Type Parameters

    • W

    Parameters

    • widget: Widget<W> | readonly Widget<W>[]

      The mandatory first widget

    • Rest ...widgets: readonly Widget<W>[]

      The list of the widgets involved in the bindings.

    Returns BaseUpdateBinder

    A clone of the current binder to chain the building configuration.

  • Backpressure operation. Instead of emitting all the events, successive events of the same type are factorized modulo a timeout. The timeout is used to send at max one event of the same type in a given duration (the timeout). For example with three mouse moves and a time out of 10ms. The first move is received and processed. The timer starts. A second mouse moves is received at T+5ms. It is for the moment not processed. A third mouse move is received at T+8ms. The second move is finally ignored and this third one not processed yet. At T+10s the third event is finally processed. Based on our own experiments, the given timeout value should be greater than 10ms to throttle some UI events.

    Parameters

    • timeout: number

      The timeout used by the throttle operation. In ms.

    Returns BaseUpdateBinder

    A clone of the current binder to chain the building configuration.

  • Specifies the conditions to fulfill to initialise, update, or execute the command while the interaction is running. A binder can have several cummulative 'when' routines.

    Parameters

    • fn: (() => boolean)

      The predicate that checks whether the command can be initialised, updated, or executed.

        • (): boolean
        • Returns boolean

    • Optional mode: WhenType

      The execution mode of the 'when' predicate. If not defined, the non-strict mode will be used.

    Returns BaseUpdateBinder

    A clone of the current binder to chain the building configuration.

Generated using TypeDoc