Last active
August 29, 2015 14:25
-
-
Save narqo/82b300a3bb209628eb07 to your computer and use it in GitHub Desktop.
How bem-core + ES6 may looks like
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @file common.blocks/functions/functions.js | |
import provide from 'ym'; | |
var toStr = Object.prototype.toString; | |
provide({ | |
isFunction : function(obj) { | |
return toStr.call(obj) === '[object Function]'; | |
}, | |
noop : function() {} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @file common.blocks/jquery/jquery.js | |
import provide from 'ym'; | |
import loader from 'loader_type_js'; | |
import cfg from 'jquery__config'; | |
function doProvide(preserveGlobal) { | |
provide(preserveGlobal? jQuery : jQuery.noConflict(true)); | |
} | |
typeof jQuery !== 'undefined'? | |
doProvide(true) : | |
loader(cfg.url, doProvide); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @file common.blocks/select/_mode/select_mode_check.js | |
import provide from 'ym'; | |
import escape from 'strings__escape'; | |
import Select from 'select'; | |
provide(Select.declMod({ modName : 'type', modVal : 'check' }, { | |
/** @override */ | |
_onButtonClick() { | |
// ··· | |
} | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment