We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 17aa644 + 8523fcd commit e010b27Copy full SHA for e010b27
frameworks/keyed/karyon/package.json
@@ -7,10 +7,10 @@
7
"issues": [801]
8
},
9
"dependencies": {
10
- "karyon": "1.8.1"
+ "karyon": "^2.0.0"
11
12
"devDependencies": {
13
- "esbuild": "0.19.2"
+ "esbuild": "^0.19.7"
14
15
"scripts": {
16
"dev":"esbuild src/app.js --outfile=dist/app.js --bundle --watch",
frameworks/keyed/karyon/src/app.js
@@ -17,6 +17,13 @@ const remove = (filter => function () {
17
rows(rows().filter(filter, this.ID));
18
})(function (row) { return row?.ID !== this; });
19
20
+const track = (ref, value, resolve) => {
21
+ const tracker = State(resolve(State.peek(ref) === value));
22
+ return State.on(ref, (i, o) =>
23
+ i === value ? tracker(resolve(true)) :
24
+ o === value && tracker(resolve(false))), tracker;
25
+};
26
+
27
const Row = (selected => (ID, text) =>
28
({is: 'tr', content: [
29
{is: 'td', class: 'col-md-1', content: ID},
@@ -25,7 +32,7 @@ const Row = (selected => (ID, text) =>
32
{is: 'td', class: 'col-md-1', content:
33
{is: 'a', action: remove, content: Icon('')}},
34
{is: 'td', class: 'col-md-6'}
- ], class: State.track(selection, ID, selected), ID, text})
35
+ ], class: track(selection, ID, selected), ID, text})
36
)(on => on && 'danger');
30
37
31
38
const Icon = name =>
0 commit comments