diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-07-19 20:59:11 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-07-20 10:34:38 +0200 |
| commit | 28d6d13844db28745bc2813e87a367131f862070 (patch) | |
| tree | 3094cb874872d932d278d98d60f79902bf08b1a0 /opendc-web/opendc-web-ui/src/data/topology.js | |
| parent | 922c84801acf931a5a29e95a08486f6df46a1fc2 (diff) | |
refactor(ui): Move page components in separate files
Diffstat (limited to 'opendc-web/opendc-web-ui/src/data/topology.js')
| -rw-r--r-- | opendc-web/opendc-web-ui/src/data/topology.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/opendc-web/opendc-web-ui/src/data/topology.js b/opendc-web/opendc-web-ui/src/data/topology.js index 14bd7562..bd4d1e4d 100644 --- a/opendc-web/opendc-web-ui/src/data/topology.js +++ b/opendc-web/opendc-web-ui/src/data/topology.js @@ -71,6 +71,13 @@ export function useActiveTopology() { } /** + * Return the current active topology. + */ +export function useTopology(topologyId, options = {}) { + return useQuery(['topologies', topologyId], { enabled: !!topologyId, ...options }) +} + +/** * Return the topologies of the specified project. */ export function useProjectTopologies(projectId, options = {}) { |
