MCPcopy Create free account
hub / github.com/baiwumm/react-admin / getLocalStorageItem

Function getLocalStorageItem

Xmw_web/src/utils/index.ts:87–97  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

85 * @author: 白雾茫茫丶
86 */
87export const getLocalStorageItem = <T>(key: string): T | null => {
88 // 获取 值
89 const item = localStorage.getItem(key);
90 // 判断是否为空
91 if (item === null) {
92 return null;
93 }
94 // 不为空返回解析后的值
95 const result: T = JSON.parse(item);
96 return result
97}
98
99/**
100 * @description: 存储 localstorage 的值

Callers 8

getInitialStateFunction · 0.90
renderFormTitleFunction · 0.90
BasiLayoutFunction · 0.90
LockSleepFunction · 0.90
EventSourceNoticeFunction · 0.90
UploadImageFunction · 0.90
index.tsFile · 0.90
logoutToLoginFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected