refactor: clean code

This commit is contained in:
Fu Diwei
2024-10-22 11:38:55 +08:00
parent 18a7bf0d66
commit 716f5f1426
26 changed files with 63 additions and 60 deletions

View File

@@ -12,12 +12,13 @@ export type NotifyContext = {
const Context = createContext({} as NotifyContext);
export const useNotify = () => useContext(Context);
interface ContainerProps {
export const useNotifyContext = () => useContext(Context);
interface NotifyProviderProps {
children: ReactNode;
}
export const NotifyProvider = ({ children }: ContainerProps) => {
export const NotifyProvider = ({ children }: NotifyProviderProps) => {
const [notify, dispatchNotify] = useReducer(notifyReducer, {});
useEffect(() => {