Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Callback when component args change #738

Open
GtrPksRnt4eatin opened this issue May 31, 2022 · 0 comments
Open

Get Callback when component args change #738

GtrPksRnt4eatin opened this issue May 31, 2022 · 0 comments

Comments

@GtrPksRnt4eatin
Copy link

GtrPksRnt4eatin commented May 31, 2022

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;
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant