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 4848 "dependencies" : {
4949 "babel-runtime" : " ^6.11.6" ,
5050 "invariant" : " ^2.2.1" ,
51- "lodash" : " ^4.12.0" ,
5251 "prop-types" : " ^15.5.7"
5352 },
5453 "peerDependencies" : {
102101 "react-tiny-virtual-list" : " ^2.0.1" ,
103102 "react-virtualized" : " ^9.2.2" ,
104103 "redux" : " ^3.5.2" ,
104+ "lodash" : " ^4.12.0" ,
105105 "rimraf" : " ^2.5.2" ,
106106 "sass-loader" : " ^3.2.0" ,
107107 "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-
41export default class Manager {
52 refs = { } ;
63
@@ -25,8 +22,7 @@ export default class Manager {
2522 }
2623
2724 getActive ( ) {
28- return find (
29- this . refs [ this . active . collection ] ,
25+ return this . refs [ this . active . collection ] . find (
3026 // eslint-disable-next-line eqeqeq
3127 ( { node} ) => node . sortableInfo . index == this . active . index
3228 ) ;
@@ -37,6 +33,13 @@ export default class Manager {
3733 }
3834
3935 getOrderedRefs ( collection = this . active . collection ) {
40- return sortBy ( this . refs [ collection ] , ( { node } ) => node . sortableInfo . index ) ;
36+ return this . refs [ collection ] . sort ( sortByIndex ) ;
4137 }
4238}
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