DEV Community

Akash Yadav
Akash Yadav

Posted on

useRefreshScreensStore

const useRefreshScreensStore = create((set) => ({
    refreshScreens: [],
    scheduleRefresh: (screen) => {
        set((state) => ({ refreshScreens: [...state.refreshScreens, screen] }));
    },
    refreshScreen: (screen) => {
        set((state) => ({ refreshScreens: state.refreshScreens.filter((item) => item !== screen) }));
    }
}));

Enter fullscreen mode Exit fullscreen mode

Top comments (0)