-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
panel and schedule visualizer components are memoized to avoid rendering when nothing changed. This improves rendering times by around 100-150% based the mock scenario.
- Loading branch information
Teo Koon Peng
authored
Sep 4, 2020
1 parent
9484c6d
commit bd7e3b7
Showing
49 changed files
with
1,306 additions
and
952 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from 'react'; | ||
import { ResourceConfigurationsType } from '../resource-manager'; | ||
import { defaultSettings, Settings } from '../settings'; | ||
import { NotificationBarContext, NotificationBarProps } from './notification-bar'; | ||
|
||
/* Declares the ResourcesContext which contains the resources used on the app*/ | ||
export const ResourcesContext = React.createContext<ResourceConfigurationsType>({}); | ||
|
||
export const SettingsContext = React.createContext(defaultSettings()); | ||
|
||
export interface AppContextProviderProps extends React.PropsWithChildren<{}> { | ||
settings: Settings; | ||
notificationDispatch: React.Dispatch<React.SetStateAction<NotificationBarProps | null>>; | ||
} | ||
|
||
export function AppContextProvider(props: AppContextProviderProps): React.ReactElement { | ||
const { settings, notificationDispatch, children } = props; | ||
return ( | ||
<SettingsContext.Provider value={settings}> | ||
<NotificationBarContext.Provider value={notificationDispatch}> | ||
{children} | ||
</NotificationBarContext.Provider> | ||
</SettingsContext.Provider> | ||
); | ||
} |
Oops, something went wrong.