mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-14 20:40:21 +02:00
11 lines
290 B
TypeScript
11 lines
290 B
TypeScript
export const setLocalStorageSettings = (type: 'player', object: any) => {
|
|
const settings = JSON.parse(localStorage.getItem('settings') || '{}');
|
|
|
|
const newSettings = {
|
|
...settings,
|
|
[type]: { ...object },
|
|
};
|
|
|
|
localStorage.setItem('settings', JSON.stringify(newSettings));
|
|
};
|