Skip to content

Allow for "null" / no output callbacks #1549

Closed
@tr8dr

Description

@tr8dr

Dash callbacks currently require at least one output. There are scenarios where one would like to act on an event from the UI, producing no output as a side-effect. Would like to be able to do:

@app.callback(None, [Input("A","value"), Input("B", "value")]
def handler(a, b):
    <some application logic>
    return

Right now one has to create a dummy container (such as a div) in the DOM and use it as a "fake" output sink:

    ...
    html.Div(id='dummy1'),
    ...

@app.callback(Output("dummy1", "children"), [Input("A","value"), Input("B", "value")]
def handler(a, b):
    <some application logic>
    return None

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions