You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not going to pass a laundry list of selectors to elementQuery, but instead, each of my Backbone Views will be responsible for:
Registering new elementQuery selectors used by the view and calling refresh() by passing true.
Basically, I will be listing the query selectors used for this view like elQueries: ['.elem1', '.elem2']
Just after the view has been rendered into the DOM, I will match the selectors from elQueries to the Grunt generated JSON object to register only selectors needed for a given view.
Unregistering elementQuery selectors that are no longer on the page (ie, when the view closes)
How does everyone feel about something like this?
The text was updated successfully, but these errors were encountered:
@jpdesigndev sorry to not respond sooner, yes I am open to a PR to unregister a selector. If it adds much file size at all, you might want to write it as a plugin in a separate JS file since I imagine not many people will be unregistering selectors.
I'm going to use this in a production environment. Is there any chance you would either add, or accept a PR for unregistering selectors?
Use case: For a single page app, I'm thinking of writing a Grunt task that will create a JSON object with all of my possible selectors like this:
I'm not going to pass a laundry list of selectors to
elementQuery
, but instead, each of my Backbone Views will be responsible for:refresh()
by passingtrue
.elQueries: ['.elem1', '.elem2']
elQueries
to the Grunt generated JSON object to register only selectors needed for a given view.How does everyone feel about something like this?
The text was updated successfully, but these errors were encountered: