Skip to content

Commit 017344c

Browse files
committed
tech(basic): add utils directory
1 parent cedc95e commit 017344c

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default as RoutePaths } from './RoutePaths'
1+
export { default as RoutePaths } from './route-paths'
File renamed without changes.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const noop = () => ''
2+
3+
export const storageAPI = (type = 'local') => {
4+
if (typeof window !== 'undefined') {
5+
if (type === 'local') {
6+
return window.localStorage
7+
}
8+
9+
return window.sessionStorage
10+
}
11+
12+
return {
13+
getItem: noop,
14+
setItem: noop,
15+
removeItem: noop,
16+
clear: noop,
17+
}
18+
}

0 commit comments

Comments
 (0)