Last active
October 14, 2018 20:13
-
-
Save pahund/c7f3b811399dbeb8f1355623e19a4352 to your computer and use it in GitHub Desktop.
Registering selectors for use with global state
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
import { registerSelectorsForUseWithGlobalState } from '@modular-toolkit/selectors'; | |
import { selectors as hackerNews } from '@modular-toolkit/demo-module'; | |
import { selectors as home } from './pages/home'; | |
import { selectors as about } from './pages/about'; | |
import { selectors as contact } from './pages/contact'; | |
const selectorMapping = { | |
'bricks.hackerNews': hackerNews, | |
'pages.home': home, | |
'pages.about': about, | |
'pages.contact': contact | |
}; | |
export default () => { | |
for (const [path, selectors] of Object.entries(selectorMapping)) { | |
registerSelectorsForUseWithGlobalState(path, selectors); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment