Interface InteractionCmdUpdateBinder<C, I, A, D>

The binder API that already knows the type of UI command and the user interaction to use (for user interactions that can be updated).

interface InteractionCmdUpdateBinder {
    bind(): Binding<C, I, A, D>;
    cancel(fn): InteractionCmdUpdateBinder<C, I, A, D>;
    catch(fn): InteractionCmdUpdateBinder<C, I, A, D>;
    configureRules(ruleName, severity): InteractionCmdUpdateBinder<C, I, A, D>;
    continuousExecution(): InteractionCmdUpdateBinder<C, I, A, D>;
    end(fn): InteractionCmdUpdateBinder<C, I, A, D>;
    endOrCancel(fn): InteractionCmdUpdateBinder<C, I, A, D>;
    first(fn): InteractionCmdUpdateBinder<C, I, A, D>;
    ifCannotExecute(fn): InteractionCmdUpdateBinder<C, I, A, D>;
    ifHadEffects(fn): InteractionCmdUpdateBinder<C, I, A, D>;
    ifHadNoEffect(fn): InteractionCmdUpdateBinder<C, I, A, D>;
    log(...level): InteractionCmdUpdateBinder<C, I, A, D>;
    name(name): InteractionCmdUpdateBinder<C, I, A, D>;
    on<W>(widget, ...widgets): InteractionCmdUpdateBinder<C, I, A, D>;
    onDynamic(node): InteractionCmdUpdateBinder<C, I, A, D>;
    preventDefault(): InteractionCmdUpdateBinder<C, I, A, D>;
    stopImmediatePropagation(): InteractionCmdUpdateBinder<C, I, A, D>;
    then(fn): InteractionCmdUpdateBinder<C, I, A, D>;
    throttle(timeout): InteractionCmdUpdateBinder<C, I, A, D>;
    when(fn, mode?): InteractionCmdUpdateBinder<C, I, A, D>;
}

Type Parameters

Hierarchy

Implemented by

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 InteractionCmdUpdateBinder<C, I, A, D>

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

  • Specifies what to do end when an interaction ends (when the last event of the interaction has occurred, but just after the interaction is reinitialised and the command finally executed and discarded / saved). A binder can have several cummulative 'end' routines.

    Parameters

    • fn: ((c, i, acc) => void)

      The callback method to specify what to do when an interaction ends.

        • (c, i, acc): void
        • Parameters

          • c: C
          • i: D
          • acc: A

          Returns void

    Returns InteractionCmdUpdateBinder<C, I, A, D>

    The binder to chain the building configuration.

  • Specifies the initialisation of the command when the interaction starts. Each time the interaction starts, an instance of the command is created and configured by the given callback. A binder can have several cummulative 'first' routines.

    Parameters

    • fn: ((c, i, acc) => void)

      The callback method that initialises the command. This callback takes as arguments both the command and interaction data involved in the binding.

        • (c, i, acc): void
        • Parameters

          • c: C
          • i: D
          • acc: A

          Returns void

    Returns InteractionCmdUpdateBinder<C, I, A, D>

    The binder to chain the building configuration.

  • Specifies what to do end when an interaction ends (after the end/endOrCancel routines) and the command did not produce an effect. A binder can have several cummulative 'ifHadNoEffect' routines.

    Parameters

    • fn: ((c, i, acc) => void)

      The callback method to specify what to do when an interaction ends and the command did not produce an effect.

        • (c, i, acc): void
        • Parameters

          • c: C
          • i: D
          • acc: A

          Returns void

    Returns InteractionCmdUpdateBinder<C, I, A, D>

    The binder to chain the building configuration.

  • Permits to update the command on each interaction update. A binder can have several cummulative 'then' routines. This routine is called only if 'when' returns true (ie only if the condition for producing the command is respected). See 'ifCannotExecute' for a 'then' when this condition is not respected.

    Parameters

    • fn: ((c, i, acc) => void) | ((c) => void)

      The callback method that updates the command. This callback takes as arguments the command to update and the ongoing interactions (and its parameters).

    Returns InteractionCmdUpdateBinder<C, I, A, D>

    The 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 InteractionCmdUpdateBinder<C, I, A, D>

    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: ((i, acc) => boolean)

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

        • (i, acc): boolean
        • Parameters

          • i: D
          • acc: Readonly<A>

          Returns boolean

    • Optional mode: WhenType

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

    Returns InteractionCmdUpdateBinder<C, I, A, D>

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

Generated using TypeDoc