Skip to content

Consider adding unpublish function #2

@jamesplease

Description

@jamesplease

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions