Skip to content

Commit

Permalink
install global API
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Apr 26, 2018
1 parent c13ac49 commit 946b5a5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
18 changes: 14 additions & 4 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,21 @@
module.exports = factory();
}
}(this, function() {
"use strict";
"use strict";

function Moon() {
var config = {
silent: ("development" === "production") || (typeof console === "undefined")
};

}
var createGlobal = function (Moon) {
Moon.config = config;
};

return Moon;
function Moon() {

}

createGlobal(Moon);

return Moon;
}));
2 changes: 1 addition & 1 deletion dist/moon.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* Released under the MIT License
* https://kbrsh.github.io/moon
*/
!function(n,o){"undefined"==typeof module?n.Moon=o():module.exports=o()}(this,function(){"use strict";return function(){}});
!function(n,o){"undefined"==typeof module?n.Moon=o():module.exports=o()}(this,function(){"use strict";function n(){}return n.config={silent:!0},n});
6 changes: 5 additions & 1 deletion src/global/global.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Moon.config = {
export const config = {
silent: (process.env.MOON_ENV === "production") || (typeof console === "undefined")
};

export const createGlobal = (Moon) => {
Moon.config = config;
};
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import { createGlobal } from "./global/global.js";

export default function Moon() {

}

createGlobal(Moon);

0 comments on commit 946b5a5

Please sign in to comment.