This file contains hidden or 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
const quickSort = (array) => { | |
if (array.length < 2) { | |
return array | |
} | |
const pivot = array[0] | |
const arrayWithoutPivot = array.slice(1) | |
const less = arrayWithoutPivot.filter((n) => n < pivot) | |
const greater = arrayWithoutPivot.filter((n) => n > pivot) |
This file contains hidden or 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
// think of it outside the context of the router, if you had pluggable | |
// portions of your `render`, you might do it like this | |
<App children={{main: <Users/>, sidebar: <UsersSidebar/>}}/> | |
// So with the router it looks like this: | |
const routes = ( | |
<Route component={App}> | |
<Route path="groups" components={{main: Groups, sidebar: GroupsSidebar}}/> | |
<Route path="users" components={{main: Users, sidebar: UsersSidebar}}> | |
<Route path="users/:userId" component={Profile}/> |