File tree Expand file tree Collapse file tree 6 files changed +38
-33
lines changed Expand file tree Collapse file tree 6 files changed +38
-33
lines changed Original file line number Diff line number Diff line change 17
17
"url" : " https://github.com/krausest/js-framework-benchmark.git"
18
18
},
19
19
"dependencies" : {
20
- "sinuous" : " 0.8.1 "
20
+ "sinuous" : " 0.9.0 "
21
21
},
22
22
"devDependencies" : {
23
23
"@babel/core" : " 7.4.4" ,
Original file line number Diff line number Diff line change @@ -33,12 +33,26 @@ const App = () => {
33
33
const run = ( ) => data ( buildData ( 1000 ) ) && selected ( null ) ;
34
34
const runLots = ( ) => data ( buildData ( 10000 ) ) && selected ( null ) ;
35
35
const add = ( ) => data ( data ( ) . concat ( buildData ( 1000 ) ) ) ;
36
+ const clear = ( ) => data ( [ ] ) && selected ( null ) ;
37
+ const removeOrSelect = ( e ) => e . target . matches ( '.remove' ) ? remove ( e ) : select ( e ) ;
38
+ const select = ( e ) => selected ( getParentId ( e . target ) ) ;
39
+
40
+ let rowObject ;
41
+ const selected = ( id ) => {
42
+ if ( rowObject ) rowObject . selected = '' ;
43
+ const d = data ( ) ;
44
+ if ( id && ( rowObject = d . find ( d => d . id === id ) ) ) {
45
+ rowObject . selected = 'danger' ;
46
+ }
47
+ } ;
48
+
36
49
const update = ( ) => {
37
50
const d = data ( ) ;
38
51
for ( let i = 0 ; i < d . length ; i += 10 ) {
39
52
d [ i ] . label += ' !!!' ;
40
53
}
41
54
} ;
55
+
42
56
const swapRows = ( ) => {
43
57
const d = data ( ) ;
44
58
if ( d . length > 998 ) {
@@ -48,16 +62,7 @@ const App = () => {
48
62
data ( d ) ;
49
63
}
50
64
} ;
51
- const clear = ( ) => data ( [ ] ) && selected ( null ) ;
52
- const removeOrSelect = ( e ) => e . target . matches ( '.remove' ) ? remove ( e ) : select ( e ) ;
53
- const select = ( e ) => selected ( getParentId ( e . target ) ) ;
54
- const selected = ( ( tr ) => ( id ) => {
55
- if ( tr ) tr . selected = '' ;
56
- const d = data ( ) ;
57
- if ( id && ( tr = d . find ( d => d . id === id ) ) ) {
58
- tr . selected = 'danger' ;
59
- }
60
- } ) ( ) ;
65
+
61
66
const remove = ( e ) => {
62
67
const d = data ( ) ;
63
68
const idx = d . findIndex ( d => d . id === getParentId ( e . target ) ) ;
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments