Skip to content

Forward port has_model to the 8.x widget manager #3378

@jasongrout

Description

@jasongrout

In #3377, I introduce has_model in the base widget manager class, simplifying logic.

Right now we have a confusing get_model method:

  • In the base widget manager, it returns undefined if the model is not registered, which means that it can be used to synchronously check if a model is registered. This means the function is not purely async.
  • In the jlab widget manager, the function returns a rejected promise if the model is not registered, making the function a truly async function, but leaving us without a way to easily check synchronously if a model is registered.

Once we have has_model by porting #3377 to master, I think we can change the base get_model to be a truly async function like it is in the jlab manager now. This is a breaking change, so would need to be in widgets 8.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions