@riotjs/dom-bindings
Advanced tools
Comparing version 0.6.0 to 0.6.1
import domdiff from 'domdiff'; | ||
import curry from 'curri'; | ||
@@ -567,4 +566,11 @@ /** | ||
return { | ||
...tag, | ||
mount: curry(tag.mount.bind(tag))(node) | ||
mount(scope) { | ||
return tag.mount(node, scope) | ||
}, | ||
update(scope) { | ||
return tag.update(scope) | ||
}, | ||
unmount(scope) { | ||
return tag.unmount(scope) | ||
} | ||
} | ||
@@ -571,0 +577,0 @@ } |
@@ -1119,19 +1119,2 @@ (function (global, factory) { | ||
/** | ||
* Function to curry any javascript method | ||
* @param {Function} fn - the target function we want to curry | ||
* @param {...[args]} acc - initial arguments | ||
* @returns {Function|*} it will return a function until the target function | ||
* will receive all of its arguments | ||
*/ | ||
function curry(fn, ...acc) { | ||
return (...args) => { | ||
args = [...acc, ...args]; | ||
return args.length < fn.length ? | ||
curry(fn, ...args) : | ||
fn(...args) | ||
} | ||
} | ||
/** | ||
* Create a new tag object if it was registered before, otherwise fallback to the simple | ||
@@ -1190,4 +1173,11 @@ * template chunk | ||
return { | ||
...tag, | ||
mount: curry(tag.mount.bind(tag))(node) | ||
mount(scope) { | ||
return tag.mount(node, scope) | ||
}, | ||
update(scope) { | ||
return tag.update(scope) | ||
}, | ||
unmount(scope) { | ||
return tag.unmount(scope) | ||
} | ||
} | ||
@@ -1194,0 +1184,0 @@ } |
{ | ||
"name": "@riotjs/dom-bindings", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Riot.js DOM bindings", | ||
@@ -56,5 +56,4 @@ "main": "dist/umd.dom-bindings.js", | ||
"dependencies": { | ||
"curri": "^1.0.0", | ||
"domdiff": "^2.0.0" | ||
} | ||
} |
import { ATTRIBUTE } from '../expressions/expression-types' | ||
import curry from 'curri' | ||
import template from '../template' | ||
@@ -59,5 +58,12 @@ | ||
return { | ||
...tag, | ||
mount: curry(tag.mount.bind(tag))(node) | ||
mount(scope) { | ||
return tag.mount(node, scope) | ||
}, | ||
update(scope) { | ||
return tag.update(scope) | ||
}, | ||
unmount(scope) { | ||
return tag.unmount(scope) | ||
} | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
2815
98918
- Removedcurri@^1.0.0
- Removedcurri@1.0.1(transitive)