人生轨迹代码初始化

This commit is contained in:
2025-12-21 16:57:54 +08:00
parent 06a3638c29
commit f3c06ce6af
42 changed files with 7746 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import { useState, useEffect } from 'react';
import { Store } from '../utils/store';
export function useStoreData() {
const [data, setData] = useState(Store.get());
useEffect(() => {
const handleUpdate = () => {
setData(Store.get());
};
window.addEventListener('store-updated', handleUpdate);
return () => window.removeEventListener('store-updated', handleUpdate);
}, []);
return data;
}