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

Consider adding unpublish function #2

Open
jamesplease opened this issue Mar 19, 2014 · 0 comments
Open

Consider adding unpublish function #2

jamesplease opened this issue Mar 19, 2014 · 0 comments

Comments

@jamesplease
Copy link
Contributor

For when things are being destroyed. It would be tedious to to keep track of all of the things that you've published, though. Ideally you would unregister all of your associated variables at once.

// yuck
futureVars.unpublish( 'myName' );
futureVars.unpublish( 'yourName' );
futureVars.unpublish( 'dogName' );

// better
futureVars.unpublish();

This would require keeping tabs on where things come from. One solution would be registering things under a name, which would only be used for unregistering.

futureVars.registerUnder( 'moduleOne', 'myName', 'Jmeas' );
futureVars.registerUnder( 'moduleOne', 'yourName', 'Someone' );
futureVars.registerUnder( 'moduleOne', 'dogName', 'Skip' );

futureVars.unpublish( 'moduleOne' );

This would require keeping a store of all registered variables internally.

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