MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / loadHistory

Method loadHistory

src/lib/searchHistory.js:23–31  ·  view source on GitHub ↗

* Load history from localStorage * @param {string} key Storage key * @returns {Array } History items

(key)

Source from the content-addressed store, hash-verified

21 * @returns {Array<string>} History items
22 */
23 loadHistory(key) {
24 try {
25 const stored = localStorage.getItem(key);
26 return stored ? JSON.parse(stored) : [];
27 } catch (error) {
28 console.warn("Failed to load search history:", error);
29 return [];
30 }
31 }
32
33 /**
34 * Save history to localStorage

Callers 1

constructorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected