sprae 1.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/node.js.yml +30 -0
- package/examples/todomvc.html +100 -0
- package/package.json +8 -2
- package/plan.md +28 -6
- package/r&d.md +104 -9
- package/readme.md +148 -77
- package/sprae.js +676 -253
- package/sprae.js.map +7 -0
- package/sprae.min.js +1 -1
- package/src/core.js +37 -101
- package/src/directives.js +259 -0
- package/src/index.js +2 -2
- package/test/index.html +5 -2
- package/test/test.js +191 -72
- package/src/directives/aria.js +0 -10
- package/src/directives/common.js +0 -15
- package/src/directives/data.js +0 -10
- package/src/directives/each.js +0 -53
- package/src/directives/if.js +0 -31
- package/src/directives/index.js +0 -11
- package/src/directives/on.js +0 -12
- package/src/directives/prop.js +0 -10
- package/src/directives/text.js +0 -10
- package/src/directives/value.js +0 -26
- package/src/directives/with.js +0 -21
package/src/directives/with.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import sprae, { directive, parseExpr } from '../core.js'
|
|
2
|
-
|
|
3
|
-
directive(':with', (el, expr, rootValues) => {
|
|
4
|
-
let evaluate = parseExpr(expr);
|
|
5
|
-
|
|
6
|
-
// it subsprays with shadowed values
|
|
7
|
-
// rootValues get updated by parent directives
|
|
8
|
-
// subscope doesn't contain reactive values
|
|
9
|
-
let subscope = Object.create(rootValues)
|
|
10
|
-
|
|
11
|
-
// FIXME: wonder if we better pass initial state rather than values snapshot, to let subtree subscribe to more complete set
|
|
12
|
-
// FIXME: likely initial set can be reactive itself then
|
|
13
|
-
Object.assign(subscope, evaluate(rootValues))
|
|
14
|
-
let [subvalues, subupdate] = sprae(el, subscope)
|
|
15
|
-
|
|
16
|
-
return (values) => {
|
|
17
|
-
let withValues = evaluate(values);
|
|
18
|
-
subupdate(withValues)
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
|