MCPcopy Create free account
hub / github.com/module-federation/module-federation-examples / useDrawer

Function useDrawer

shared-routing/shell/src/Shell.js:14–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12const ProfilePage = React.lazy(() => import('profile/ProfilePage'));
13
14function useDrawer() {
15 const { value, setItem } = useLocalStorageSync('@shared-routing/appdrawer/open');
16
17 return {
18 open: value,
19 closeDrawer() {
20 setItem(false);
21 },
22 openDrawer() {
23 setItem(true);
24 },
25 };
26}
27
28export default function Shell() {
29 const drawer = useDrawer();

Callers 1

ShellFunction · 0.85

Calls 1

useLocalStorageSyncFunction · 0.90

Tested by

no test coverage detected