Skip to content

Commit

Permalink
Merge pull request #17 from mokkabonna/amd-support
Browse files Browse the repository at this point in the history
Fixed case where r.js didn't give the module a name
  • Loading branch information
nbubna committed Mar 10, 2014
2 parents 8808cad + ce3cdf6 commit f51a55e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/store2.js
Expand Up @@ -4,7 +4,7 @@
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
;(function(window) {
;(function(window, define) {
var _ = {
version: "<%= pkg.version %>",
areas: {},
Expand Down Expand Up @@ -212,8 +212,8 @@
// safely setup store.session (throws exception in FF for file:/// urls)
store.area("session", (function(){try{ return sessionStorage; }catch(e){}})());

if (typeof window.define === 'function' && window.define.amd !== undefined) {
window.define(function () {
if (typeof define === 'function' && define.amd !== undefined) {
define(function () {
return store;
});
} else if (typeof module !== 'undefined' && module.exports) {
Expand All @@ -222,4 +222,4 @@
window.store = store;
}

})(window);
})(window, window.define);

0 comments on commit f51a55e

Please sign in to comment.