File tree Expand file tree Collapse file tree 3 files changed +6054
-7
lines changed Expand file tree Collapse file tree 3 files changed +6054
-7
lines changed Original file line number Diff line number Diff line change 48
48
"dependencies" : {
49
49
"babel-runtime" : " ^6.11.6" ,
50
50
"invariant" : " ^2.2.1" ,
51
- "lodash" : " ^4.12.0" ,
52
51
"prop-types" : " ^15.5.7"
53
52
},
54
53
"peerDependencies" : {
102
101
"react-tiny-virtual-list" : " ^2.0.1" ,
103
102
"react-virtualized" : " ^9.2.2" ,
104
103
"redux" : " ^3.5.2" ,
104
+ "lodash" : " ^4.12.0" ,
105
105
"rimraf" : " ^2.5.2" ,
106
106
"sass-loader" : " ^3.2.0" ,
107
107
"stack-source-map" : " ^1.0.4" ,
Original file line number Diff line number Diff line change 1
- import find from 'lodash/find' ;
2
- import sortBy from 'lodash/sortBy' ;
3
-
4
1
export default class Manager {
5
2
refs = { } ;
6
3
@@ -25,8 +22,7 @@ export default class Manager {
25
22
}
26
23
27
24
getActive ( ) {
28
- return find (
29
- this . refs [ this . active . collection ] ,
25
+ return this . refs [ this . active . collection ] . find (
30
26
// eslint-disable-next-line eqeqeq
31
27
( { node} ) => node . sortableInfo . index == this . active . index
32
28
) ;
@@ -37,6 +33,13 @@ export default class Manager {
37
33
}
38
34
39
35
getOrderedRefs ( collection = this . active . collection ) {
40
- return sortBy ( this . refs [ collection ] , ( { node } ) => node . sortableInfo . index ) ;
36
+ return this . refs [ collection ] . sort ( sortByIndex ) ;
41
37
}
42
38
}
39
+
40
+ function sortByIndex (
41
+ { node : { sortableInfo : { index : index1 } } } ,
42
+ { node : { sortableInfo : { index : index2 } } }
43
+ ) {
44
+ return ( index1 - index2 ) ;
45
+ }
You can’t perform that action at this time.
0 commit comments