Skip to content

Get Callback when component args change #738

Open
@GtrPksRnt4eatin

Description

@GtrPksRnt4eatin

Hello, not really an issue but more a question/feature request.
Is there any way that i can trigger a callback function on a rivets components viewModel anytime the arguments to the component change? I have a plugin that needs some manual setup/configuration within the view. I would like to trigger the functions that do this from within the component every time the arguments change. I was thinking something along the lines of the following:

rivets.components['session-chooser'] = {
template: function() { return SessionChooser.prototype.HTML; },
initialize: function(el,attr) {
let viewModel = new SessionChooser(el,attr);
this.observers.event.callback <- point this at a function on the viewModel somehow or add another observer to do so..
return viewModel;
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions