Confirmed users, Bureaucrats and Sysops emeriti
2,088
edits
| Line 42: | Line 42: | ||
==Lazily Load Services== | ==Lazily Load Services== | ||
The [https://developer.mozilla.org/en/XPCOMUtils.jsm#Methods XPCOMUtils JavaScript module] provides two methods for lazily loading things: | |||
* defineLazyGetter() defines a function on a specified object that acts as a getter which will be created the first time it's used. [http://mxr.mozilla.org/mozilla-central/search?string=defineLazyGetter See examples]. | |||
* defineLazyServiceGetter() defines a function on a specified object which acts as a getter for a service. The service isn't obtained until the first time it's used. [http://mxr.mozilla.org/mozilla-central/search?string=defineLazyServiceGetter See examples]. | |||
==Reduce File I/O== | ==Reduce File I/O== | ||