flaretailjs / flaretail.js

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

Closed kyoshino closed 8 years ago

kyoshino commented 8 years ago

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_]]),
};
kyoshino commented 8 years ago

Views have to be cached as well.