MCPcopy Index your code
hub / github.com/NikLever/ThreeJS-PathEditor / write

Method write

store.js:17–30  ·  view source on GitHub ↗
( config, nodes )

Source from the content-addressed store, hash-verified

15 }
16
17 write( config, nodes ) {
18 const serializedData = localStorage.getItem( Store.namespace );
19 const data = serializedData ? JSON.parse(serializedData) : {};
20 const config1 = {};
21 for (const [key, value] of Object.entries(config)) {
22 if (typeof value != "function" ) config1[key] = value;
23 }
24 this.udoArr.push( JSON.stringify(data) );
25 if (this.udoArr.length>6) this.udoArr.shift();
26 const path = { config: config1, nodes };
27 data[config.name] = path;
28 data['activePath'] = config.name;
29 localStorage.setItem(Store.namespace, JSON.stringify(data));
30 }
31
32 read( key ) {
33 const serializedData = localStorage.getItem( Store.namespace );

Callers 2

copyMethod · 0.95
renderMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected