rescribet/link-redux

View on GitHub
src/hooks/useTopology.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import React from "react";

import { LinkRenderCtx } from "../contexts/LinkRenderCtx";
import { TopologyType } from "../types";

/** Get the current topology */
export function useTopology(): TopologyType {
  return React.useContext(LinkRenderCtx).topology;
}