forked from reactabular/treetabular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
breaking(sort) - Replace
sort
with more generic wrap
This is handy if you want to perform an operation against root level nodes.
- Loading branch information
Showing
7 changed files
with
97 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { compose } from 'redux'; | ||
import pack from './pack'; | ||
import unpack from './unpack'; | ||
|
||
function wrap({ | ||
idField, | ||
operations | ||
} = {}) { | ||
if (!operations) { | ||
throw new Error('tree.wrap - Missing operations!'); | ||
} | ||
|
||
return compose(...[ | ||
unpack({ idField }), | ||
...operations, | ||
pack({ idField }) | ||
]); | ||
} | ||
|
||
export default wrap; |