prop and withAttr work in progress
This commit is contained in:
parent
e1473dcce8
commit
477e73f300
4 changed files with 32 additions and 8 deletions
8
util/prop.js
Normal file
8
util/prop.js
Normal 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
5
util/withAttr.js
Normal 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))
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue