КС
Size: a a a
КС
КС
КС
import { myStore } from '$lib/mystore.js';
let $myStore;
myStore.subscribe(value => $myStore = value);
М
КС
КС
КС
КС
М
М
КС
export const customStore = (initVal, initFunc) => {
const { set: _set, subscribe } = writable(initVal, initFunc);
let currentValue;
const set = value => {
if (LUL) {
currentValue = value;
_set(value);
}
};
const update = updateFunc => {
if (LUL) {
currentValue = updateFunc(currentValue);
_set(currentValue);
}
};
return {
subscribe,
set,
update,
};
};
М
MS
КС
КС
new Event('custom-event')
MS
КС
КС