def METHOD_NAME(n, dismissed_toast, store):
    """
    This callback manages the message store. If the "generate" button is
    clicked we add an item to the store. If one of the toasts is dismissed we
    remove the corresponding item from the store. To figure out which of these
    happened, we use callback context.
    """
    # determine which input triggered the callback
    ctx = dash.callback_context
    triggered = ctx.triggered[0]["prop_id"]
    if n and triggered == "button.n_clicks":
        # button has been clicked, add a new message to the existing list
        # generate a random id using uuid.uuid4.
        # We could add additional fields other than just number and id here
        # such as a header, icon color etc.
        return [*store, {"number": randint(0, 100), "id": str(uuid4())}]
    elif triggered.endswith(".n_dismiss"):
        # one of the messages has been dismissed
        # recover id of dismissed toast
        id_, _ = triggered.split(".")
        id_ = json.loads(id_)["id"]
        # filter it from the store
        return [item for item in store if item["id"] != id_]
    return []