forked from Vizzuality/mangrove-atlas
-
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.
Merge pull request Vizzuality#36 from Vizzuality/feature/url-to-state
feat(NA): Url to state feature.
- Loading branch information
Showing
16 changed files
with
324 additions
and
291 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { all, fork } from 'redux-saga/effects'; | ||
|
||
import queryState from 'utils/query-state'; | ||
|
||
import pagesSagas from 'modules/pages/sagas'; | ||
import mapSagas from 'modules/map/sagas'; | ||
import mapStylesSagas from 'modules/map-styles/sagas'; | ||
import layersSagas from 'modules/layers/sagas'; | ||
import widgetsSagas from 'modules/widgets/sagas'; | ||
import locationsSagas from 'modules/locations/sagas'; | ||
import dashboardsSagas from 'modules/dashboards/sagas'; | ||
import languagesSagas from 'modules/languages/sagas'; | ||
|
||
export default function* root() { | ||
yield all([ | ||
fork(queryState.sagas.bind(queryState)), | ||
fork(pagesSagas), | ||
fork(mapSagas), | ||
fork(mapStylesSagas), | ||
fork(layersSagas), | ||
fork(widgetsSagas), | ||
fork(locationsSagas), | ||
fork(dashboardsSagas), | ||
fork(languagesSagas), | ||
]); | ||
}; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,34 @@ | ||
import * as actions from './actions'; | ||
import * as reducers from './reducers'; | ||
import initialState from './initial-state'; | ||
import sagas from './sagas'; | ||
import sagas, { restoreMapState } from './sagas'; | ||
|
||
import queryState from 'utils/query-state'; | ||
|
||
/** | ||
* queryState.add register the namespace for url to state actions. | ||
* The name property will become the query param. | ||
* It is suppossed to be semantic: | ||
* | ||
* For namespace 'map' | ||
* encode selector | ||
* after any of these actions are triggered. | ||
* | ||
* For namespace 'map' | ||
* decode trigger | ||
* after all of these actions have happened. | ||
*/ | ||
queryState.add({ | ||
name: 'map', | ||
encode: { | ||
after: [ | ||
actions.setBasemap, | ||
], | ||
selector: state => ({ basemap: state.map.basemap }) | ||
}, | ||
decode: { | ||
trigger: restoreMapState | ||
} | ||
}); | ||
|
||
export { actions, initialState, reducers, sagas }; |
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
Oops, something went wrong.