A JavaScript library for Firefox application development, consisting of WAI-ARIA-driven accessible widgets, a lightweight app framework, and convenient utility functions.
Other
1
stars
2
forks
source link
Cache controller instances on the prototype for the router #42
The router will cache the instance on the prototype in a Map for later use.
BzDeck.HomePageController.prototype.routes = {
pattern: '/home/(\\w+)',
catch_all: true,
// There will be
map: new Map([['/home/index', _instance_]]),
};
BzDeck.ProfilePageController.prototype.routes = {
pattern: '/profile/(.+)',
catch_all: false,
// There will be
map: new Map([['/profile/foo@domain', _instance_], ['/profile/bar@domain', _instance_]]),
};
The router will cache the instance on the prototype in a
Map
for later use.