@@ -64,15 +64,18 @@ const N = [
64
64
65
65
let nextId = 1 ;
66
66
67
+ const buildLabel = ( ) =>
68
+ bau . state (
69
+ `${ A [ random ( A . length ) ] } ${ C [ random ( C . length ) ] } ${ N [ random ( N . length ) ] } `
70
+ ) ;
71
+
67
72
const buildData = ( count ) => {
68
73
const data = new Array ( count ) ;
69
74
70
75
for ( let i = 0 ; i < count ; i ++ ) {
71
76
data [ i ] = {
72
77
id : nextId ++ ,
73
- label : `${ A [ random ( A . length ) ] } ${ C [ random ( C . length ) ] } ${
74
- N [ random ( N . length ) ]
75
- } `,
78
+ label : buildLabel ( ) ,
76
79
} ;
77
80
}
78
81
@@ -99,7 +102,8 @@ const add = () => {
99
102
const update = ( ) => {
100
103
for ( let i = 0 ; i < dataState . val . length ; i += 10 ) {
101
104
const r = dataState . val [ i ] ;
102
- dataState . val [ i ] . label = r . label + " !!!" ;
105
+ const label = dataState . val [ i ] . label ;
106
+ label . val = r . label . val + " !!!" ;
103
107
}
104
108
} ;
105
109
@@ -131,12 +135,8 @@ const select = ({ id, event }) => {
131
135
const Row = ( { id, label } ) =>
132
136
tr (
133
137
{
134
- class : {
135
- deps : [ selectedState ] ,
136
- renderProp : ( selected ) => ( selected == id ? "danger" : "" ) ,
137
- } ,
138
+ class : ( ) => ( selectedState . val == id ? "danger" : "" ) ,
138
139
} ,
139
-
140
140
td ( { class : "col-md-1" } , id ) ,
141
141
td (
142
142
{ class : "col-md-4" } ,
@@ -208,14 +208,7 @@ const Main = () =>
208
208
Jumbotron ( { } ) ,
209
209
table (
210
210
{ class : "table table-hover table-striped test-data" } ,
211
- bau . bind ( {
212
- deps : [ dataState ] ,
213
- render :
214
- ( { renderItem } ) =>
215
- ( arr ) =>
216
- tbody ( arr . map ( renderItem ( ) ) ) ,
217
- renderItem : ( ) => Row ,
218
- } ) ,
211
+ bau . loop ( dataState , tbody ( ) , Row ) ,
219
212
span ( {
220
213
class : "preloadicon glyphicon glyphicon-remove" ,
221
214
"aria-hidden" : true ,
0 commit comments