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 = () => {
1717 const
1818 array = OArray ( ) ,
1919 selected = Observer . mutable ( null ) ,
20+ selector = selected . selector ( 'danger' , null ) ,
2021 run = ( ) => {
2122 array . splice ( 0 , array . length ) ;
2223 appendData ( 1000 ) ;
@@ -46,7 +47,7 @@ const App = () => {
4647 array . splice ( idx , 1 ) ;
4748 } ,
4849 select = idx => {
49- selected . set ( array [ idx ] ) ;
50+ selected . set ( array [ idx ] . label ) ;
5051 } ;
5152
5253 function appendData ( count ) {
@@ -55,7 +56,7 @@ const App = () => {
5556 let label = Observer . mutable ( `${ adjectives [ _random ( adjectives . length ) ] } ${ colours [ _random ( colours . length ) ] } ${ nouns [ _random ( nouns . length ) ] } ` ) ;
5657
5758 const dom =
58- < tr class = { selected . map ( sel => sel === dom ? "danger" : "" ) } >
59+ < tr class = { selector ( label ) } >
5960 < td class = 'col-md-1' $textContent = { idCounter ++ } />
6061 < td class = 'col-md-4' > < a $clickHandler = { select } $textContent = { label } /> </ td >
6162 < 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