Last active
December 11, 2021 19:34
-
-
Save jasonleehodges/c7377501a643aff7e650e109021408c2 to your computer and use it in GitHub Desktop.
Counter Selector File
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
export const selectCount = (state: RootState) => state.counter.value; | |
export const selectCountFormatted = | |
(formatter: "$" | "%") => (state: RootState) => | |
`${formatter === "$" ? "$" : ""}${selectCount(state)}${ | |
formatter === "%" ? "%" : "" | |
}`; | |
export const selectCountAndStatus = (state: RootState) => | |
`The current count is ${selectCount(state)} and the status is ${ | |
state.counter.status | |
}`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment