File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
frameworks/keyed/destam-dom/src Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ const App = () => {
17
17
const
18
18
array = OArray ( ) ,
19
19
selected = Observer . mutable ( null ) ,
20
+ selector = selected . selector ( 'danger' , null ) ,
20
21
run = ( ) => {
21
22
array . splice ( 0 , array . length ) ;
22
23
appendData ( 1000 ) ;
@@ -46,7 +47,7 @@ const App = () => {
46
47
array . splice ( idx , 1 ) ;
47
48
} ,
48
49
select = idx => {
49
- selected . set ( array [ idx ] ) ;
50
+ selected . set ( array [ idx ] . label ) ;
50
51
} ;
51
52
52
53
function appendData ( count ) {
@@ -55,7 +56,7 @@ const App = () => {
55
56
let label = Observer . mutable ( `${ adjectives [ _random ( adjectives . length ) ] } ${ colours [ _random ( colours . length ) ] } ${ nouns [ _random ( nouns . length ) ] } ` ) ;
56
57
57
58
const dom =
58
- < tr class = { selected . map ( sel => sel === dom ? "danger" : "" ) } >
59
+ < tr class = { selector ( label ) } >
59
60
< td class = 'col-md-1' $textContent = { idCounter ++ } />
60
61
< td class = 'col-md-4' > < a $clickHandler = { select } $textContent = { label } /> </ td >
61
62
< td class = 'col-md-1' > < a $clickHandler = { remove } > < span class = 'glyphicon glyphicon-remove' aria-hidden = "true" /> </ a > </ td >
You can’t perform that action at this time.
0 commit comments