made with esnextbin
Last active
October 25, 2016 15:21
-
-
Save aledoroshenko/3053b96d8c622bc29be99fa188f3e801 to your computer and use it in GitHub Desktop.
esnextbin sketch
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>ESNextbin Sketch</title> | |
<!-- put additional styles and scripts here --> | |
</head> | |
<body> | |
<!-- put markup and other contents here --> | |
<div class="ncc-grid-block secondary-nac-block jstest"></div> | |
</body> | |
</html> |
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
import $ from 'jquery'; | |
import _ from 'lodash'; | |
function needForceClear(element) { | |
var $element = $(element); | |
return _.map( | |
['ncc-grid-block', 'secondary-nav-block', 'customer-header'], | |
$element.hasClass.bind($element) | |
) | |
} | |
console.log(needForceClear(undefined)); | |
console.log(needForceClear($('.ncc-grid-block'))); |
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
{ | |
"name": "esnextbin-sketch", | |
"version": "0.0.0", | |
"dependecies": { | |
"lodash": "~4.14.1", | |
"expect": "~1.20.2", | |
"jquery": "~3.1.1" | |
}, | |
"dependencies": { | |
"jquery": "3.1.1", | |
"lodash": "4.16.4" | |
} | |
} |
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
'use strict'; | |
var _jquery = require('jquery'); | |
var _jquery2 = _interopRequireDefault(_jquery); | |
var _lodash = require('lodash'); | |
var _lodash2 = _interopRequireDefault(_lodash); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
function needForceClear(element) { | |
var $element = (0, _jquery2.default)(element); | |
return _lodash2.default.map(['ncc-grid-block', 'secondary-nav-block', 'customer-header'], $element.hasClass.bind($element)); | |
} | |
console.log(needForceClear(undefined)); | |
console.log(needForceClear((0, _jquery2.default)('.ncc-grid-block'))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment