Skip to content

Commit

Permalink
feat: recoil-persist 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
simeunseo committed Jul 27, 2024
1 parent f56806d commit 074978f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/atoms/atom.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DateStates, ScheduleStates, TimeStates } from 'pages/legacy/selectSchedule/types/Schedule';

import { PreferTime } from 'components/legacy/scheduleComponents/types/AvailableScheduleType';
import { DateStates, ScheduleStates } from 'pages/legacy/selectSchedule/types/Schedule';
import { atom } from 'recoil';
import { recoilPersist } from 'recoil-persist';

export const methodStateAtom = atom<boolean>({
key: 'methodStateAtom',
Expand Down Expand Up @@ -41,7 +41,10 @@ export const clickedTimeSlotAtom = atom<string>({
default: undefined,
});

const { persistAtom } = recoilPersist();

export const userNameAtom = atom<string>({
key: 'userNameAtom',
default: '',
effects_UNSTABLE: [persistAtom],
});

0 comments on commit 074978f

Please sign in to comment.