prop and withAttr work in progress

This commit is contained in:
Leo Horie 2016-05-21 01:48:11 -04:00
parent e1473dcce8
commit 477e73f300
4 changed files with 32 additions and 8 deletions

8
util/prop.js Normal file
View file

@ -0,0 +1,8 @@
"use strict"
module.exports = function(store) {
return function() {
if (arguments.length > 0) store = arguments[0]
return store
}
}

5
util/withAttr.js Normal file
View file

@ -0,0 +1,5 @@
"use strict"
module.exports = function(attrName, callback, context) {
return callback.call(context || this, attrName in e.currentTarget ? e.currentTarget[attrName] : e.currentTarget.getAttribute(attrName))
}