diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-07-07 11:46:57 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-07-07 11:46:57 +0200 |
| commit | 1ce8bf170cda2afab334cd330325cd4fbb97dab4 (patch) | |
| tree | 59911227f622a99844645b3276e73181777ab209 /opendc-web/opendc-web-ui/src/data | |
| parent | dfd2ded56780995cec6d91af37443b710d4ddb3b (diff) | |
ui: Split App container into separate components
This change splits the App container into separate pages, as a starting
point for removing much of the unnecessary state from Redux.
Diffstat (limited to 'opendc-web/opendc-web-ui/src/data')
| -rw-r--r-- | opendc-web/opendc-web-ui/src/data/project.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/opendc-web/opendc-web-ui/src/data/project.js b/opendc-web/opendc-web-ui/src/data/project.js index de2bc0d3..d4c95370 100644 --- a/opendc-web/opendc-web-ui/src/data/project.js +++ b/opendc-web/opendc-web-ui/src/data/project.js @@ -30,6 +30,13 @@ export function useProjects() { } /** + * Return the project with the specified identifier. + */ +export function useProject(projectId) { + return useSelector((state) => state.projects[projectId]) +} + +/** * Return the current active project. */ export function useActiveProject() { |
