-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor:
saveTemporary
함수를 컴포넌트에서 분리
- 스터디와 모집 공고 두 경우에서 전부 사용할 수 있음 - 컴포넌트 밖으로 함수를 분리하여 렌덜이 성능 개선 및 기능 분리
- Loading branch information
Showing
2 changed files
with
7 additions
and
7 deletions.
There are no files selected for viewing
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 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,5 @@ | ||
export const saveTemporary = (savedKey: string, type: 'STUDY' | 'RECRUITMENT', data: unknown) => { | ||
if (savedKey.length > 0) localStorage.removeItem(savedKey); | ||
const newSavedKey = `${type}-${studyId}-${uuidv1()}`; | ||
localStorage.setItem(newSavedKey, JSON.stringify(data)); | ||
}; |