1 | import { NAVIGATE } from './actions'
|
2 |
|
3 | export default store => next => action => {
|
4 | if (action.type === NAVIGATE) {
|
5 | const { apps } = store.getState()
|
6 |
|
7 | apps.items.forEach(name => {
|
8 | const app = apps.byName[name]
|
9 |
|
10 | if (typeof app.notify === 'function') {
|
11 | app.notify({
|
12 | type: 'NAVIGATE',
|
13 | payload: {
|
14 | uri: action.meta.uri
|
15 | }
|
16 | })
|
17 | }
|
18 | })
|
19 | }
|
20 |
|
21 | return next(action)
|
22 | }
|