Skip to content

Instantly share code, notes, and snippets.

@scq000
Created March 10, 2017 03:31
Show Gist options
  • Save scq000/22249e440e642ddfa901cc7a235c4e1b to your computer and use it in GitHub Desktop.
Save scq000/22249e440e642ddfa901cc7a235c4e1b to your computer and use it in GitHub Desktop.
模块化
/* global module, define,*/
;(function (root, factory) {
'use strict'
if (typeof module === 'object' && typeof module.exports === 'object') {
/**
* @type {{then:function}}
*/
module.exports = factory()
} else if (typeof define === 'function' && define.amd) {
define([], factory)
} else {
root.Thenjs = factory()
}
}(typeof window === 'object' ? window : this, function () {
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment