Callback<'Function> Type

The Central Callback type. This type serves two purposes: 1. Externally, the Serialized object is returned via the `_dash-dependencies` endpoint of a dash application to set up the dash renderer loop 2. Internally, the HandlerFunction of the Callback is evaluated when a qualified call to `_dash-update-component` is performed. As this type needs dynamic members in addition to the static members created by the default constructor, it is not recommended to use the constructor to create a callback, but rather the `singleOut` or `multiOut` members. Creating an instance of this type and registering it on the callback map of the DashApp is the equivalent of the @app.callback decorator in python.

Constructors

Constructor Description

Callback(HandlerFunction, Multi, ?PreventInitialCall, ?ClientSideFunction)

Full Usage: Callback(HandlerFunction, Multi, ?PreventInitialCall, ?ClientSideFunction)

Parameters:
    HandlerFunction : 'Function
    Multi : bool
    ?PreventInitialCall : bool
    ?ClientSideFunction : ClientSideFunction

Returns: Callback<'Function>
HandlerFunction : 'Function
Multi : bool
?PreventInitialCall : bool
?ClientSideFunction : ClientSideFunction
Returns: Callback<'Function>

Instance members

Instance member Description

this.ClientSideFunction

Full Usage: this.ClientSideFunction

Returns: ClientSideFunction option

A clientside function that should be run by this callback

Returns: ClientSideFunction option

this.HandlerFunction

Full Usage: this.HandlerFunction

Returns: 'Function

The handler function that maps the callback input components to the callback output components

Returns: 'Function

this.Multi

Full Usage: this.Multi

Returns: bool

Indicates wether the callback is a n -> i mapping (false) or n -> n mapping (true)

Returns: bool

this.PreventInitialCall

Full Usage: this.PreventInitialCall

Returns: bool

If true, the callback will not be called during initialization of the DashApp

Returns: bool

Static members

Static member Description

Callback.copy callback

Full Usage: Callback.copy callback

Parameters:
Returns: Callback<'Function>

Returns a copy of the given `Callback` (copies dynamic members aswell)

callback : Callback<'Function>
Returns: Callback<'Function>

Callback.eval args handler

Full Usage: Callback.eval args handler

Parameters:
    args : seq<obj>
    handler : Callback<'Function>

Returns: Result<obj, Exception>
args : seq<obj>
handler : Callback<'Function>
Returns: Result<obj, Exception>

Callback.evalAs args handler

Full Usage: Callback.evalAs args handler

Parameters:
    args : seq<obj>
    handler : Callback<'Function>

Returns: Result<'OutputType, Exception>
args : seq<obj>
handler : Callback<'Function>
Returns: Result<'OutputType, Exception>

Callback.getResponseObject args handler

Full Usage: Callback.getResponseObject args handler

Parameters:
Returns: CallbackResponse
args : seq<JToken>
handler : Callback<'Function>
Returns: CallbackResponse

Callback.multiOut (input, outputs, handlerFunction, ?State, ?PreventInitialCall, ?ClientSideFunction)

Full Usage: Callback.multiOut (input, outputs, handlerFunction, ?State, ?PreventInitialCall, ?ClientSideFunction)

Parameters:
Returns: Callback<'Function>

returns a callback that binds a handler function mapping from a single input component to multiple output components (1 -> n) A `CallbackInput` that represents the input component of this callback. Changes to this component signalled by the client will trigger the callback. A sequence of `CallbackOutput` that represents the output components of this callback The handler function that maps the callback input components to the callback output components A sequence of `CallbackState` that represents additional input components of this callback. In contrast to the other input componenst, these will not trigger the handler function when changed on the client. Wether to prevent the app to call this callback on initialization A client side function to execute with the callback

input : CallbackInput
outputs : seq<CallbackOutput>
handlerFunction : 'Function
?State : seq<CallbackState>
?PreventInitialCall : bool
?ClientSideFunction : ClientSideFunction
Returns: Callback<'Function>

Callback.multiOut (inputs, outputs, handlerFunction, ?State, ?PreventInitialCall, ?ClientSideFunction)

Full Usage: Callback.multiOut (inputs, outputs, handlerFunction, ?State, ?PreventInitialCall, ?ClientSideFunction)

Parameters:
    inputs : seq<CallbackInput> - A sequence of `CallbackInput` that represents the input components of this callback. Changes to any of these components signalled by the client will trigger the callback.
    outputs : seq<CallbackOutput> - A sequence of `CallbackOutput` that represents the output components of this callback
    handlerFunction : 'Function - The handler function that maps the callback input components to the callback output components
    ?State : seq<CallbackState> - A sequence of `CallbackState` that represents additional input components of this callback. In contrast to the other input componenst, these will not trigger the handler function when changed on the client.
    ?PreventInitialCall : bool - Wether to prevent the app to call this callback on initialization
    ?ClientSideFunction : ClientSideFunction - A client side function to execute with the callback

Returns: Callback<'Function>

returns a callback that binds a handler function mapping from multiple input components to multiple output components (n -> n)

inputs : seq<CallbackInput>

A sequence of `CallbackInput` that represents the input components of this callback. Changes to any of these components signalled by the client will trigger the callback.

outputs : seq<CallbackOutput>

A sequence of `CallbackOutput` that represents the output components of this callback

handlerFunction : 'Function

The handler function that maps the callback input components to the callback output components

?State : seq<CallbackState>

A sequence of `CallbackState` that represents additional input components of this callback. In contrast to the other input componenst, these will not trigger the handler function when changed on the client.

?PreventInitialCall : bool

Wether to prevent the app to call this callback on initialization

?ClientSideFunction : ClientSideFunction

A client side function to execute with the callback

Returns: Callback<'Function>

Callback.pack handler

Full Usage: Callback.pack handler

Parameters:
Returns: Callback<obj>
handler : Callback<'Function>
Returns: Callback<obj>

Callback.singleOut (input, output, handlerFunction, ?State, ?PreventInitialCall, ?ClientSideFunction)

Full Usage: Callback.singleOut (input, output, handlerFunction, ?State, ?PreventInitialCall, ?ClientSideFunction)

Parameters:
    input : CallbackInput - A `CallbackInput` that represents the input component of this callback. Changes to this component signalled by the client will trigger the callback.
    output : CallbackOutput - A `CallbackOutput` that represents the output component of this callback
    handlerFunction : 'Function - The handler function that maps the callback input components to the callback output components
    ?State : seq<CallbackState> - A sequence of `CallbackState` that represents additional input components of this callback. In contrast to the other input componenst, these will not trigger the handler function when changed on the client.
    ?PreventInitialCall : bool - Wether to prevent the app to call this callback on initialization
    ?ClientSideFunction : ClientSideFunction - A client side function to execute with the callback

Returns: Callback<'Function>

returns a callback that binds a handler function mapping from a single input component to a single output component (1 -> 1)

input : CallbackInput

A `CallbackInput` that represents the input component of this callback. Changes to this component signalled by the client will trigger the callback.

output : CallbackOutput

A `CallbackOutput` that represents the output component of this callback

handlerFunction : 'Function

The handler function that maps the callback input components to the callback output components

?State : seq<CallbackState>

A sequence of `CallbackState` that represents additional input components of this callback. In contrast to the other input componenst, these will not trigger the handler function when changed on the client.

?PreventInitialCall : bool

Wether to prevent the app to call this callback on initialization

?ClientSideFunction : ClientSideFunction

A client side function to execute with the callback

Returns: Callback<'Function>

Callback.singleOut (inputs, output, handlerFunction, ?State, ?PreventInitialCall, ?ClientSideFunction)

Full Usage: Callback.singleOut (inputs, output, handlerFunction, ?State, ?PreventInitialCall, ?ClientSideFunction)

Parameters:
    inputs : seq<CallbackInput> - A sequence of `CallbackInput` that represents the input components of this callback. Changes to any of these components signalled by the client will trigger the callback.
    output : CallbackOutput - A `CallbackOutput` that represents the output component of this callback
    handlerFunction : 'Function - The handler function that maps the callback input components to the callback output components
    ?State : seq<CallbackState> - A sequence of `CallbackState` that represents additional input components of this callback. In contrast to the other input componenst, these will not trigger the handler function when changed on the client.
    ?PreventInitialCall : bool - Wether to prevent the app to call this callback on initialization
    ?ClientSideFunction : ClientSideFunction - A client side function to execute with the callback

Returns: Callback<'Function>

returns a callback that binds a handler function mapping from multiple input components to a single output component (n -> 1)

inputs : seq<CallbackInput>

A sequence of `CallbackInput` that represents the input components of this callback. Changes to any of these components signalled by the client will trigger the callback.

output : CallbackOutput

A `CallbackOutput` that represents the output component of this callback

handlerFunction : 'Function

The handler function that maps the callback input components to the callback output components

?State : seq<CallbackState>

A sequence of `CallbackState` that represents additional input components of this callback. In contrast to the other input componenst, these will not trigger the handler function when changed on the client.

?PreventInitialCall : bool

Wether to prevent the app to call this callback on initialization

?ClientSideFunction : ClientSideFunction

A client side function to execute with the callback

Returns: Callback<'Function>

Callback.toDependencyGraph callback

Full Usage: Callback.toDependencyGraph callback

Parameters:
Returns: Callback<'Function>

Returns a copy of the callback with all dynamic fields removed that prevent the callback to be correctly serialized and returned as dependency graph at `_dash-dependencies`

callback : Callback<'Function>
Returns: Callback<'Function>