MCPcopy
hub / github.com/wanglin2/mind-map / getData

Function getData

web/src/api/index.js:14–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12
13// 获取缓存的思维导图数据
14export const getData = () => {
15 // 接管模式
16 if (window.takeOverApp) {
17 mindMapData = window.takeOverAppMethods.getMindMapData()
18 return mindMapData
19 }
20 // 操作本地文件模式
21 if (vuexStore.state.isHandleLocalFile) {
22 return Vue.prototype.getCurrentData()
23 }
24 let store = localStorage.getItem(SIMPLE_MIND_MAP_DATA)
25 if (store === null) {
26 return simpleDeepClone(exampleData)
27 } else {
28 try {
29 return JSON.parse(store)
30 } catch (error) {
31 return simpleDeepClone(exampleData)
32 }
33 }
34}
35
36// 存储思维导图数据
37export const storeData = data => {

Callers 1

storeDataFunction · 0.85

Calls 1

simpleDeepCloneFunction · 0.90

Tested by

no test coverage detected