Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
register(adapterId, (wiredEventTarget) => {
done = false;
add(wiredEventTargets, wiredEventTarget);
wiredEventTarget.dispatchEvent(new ValueChangedEvent({ data: undefined, error: undefined }));
wiredEventTarget.addEventListener('connect', () => {
done = false;
lastConfig = {};
add(wiredEventTargets, wiredEventTarget);
});
wiredEventTarget.addEventListener('disconnect', () => {
done = true;
lastConfig = undefined;
const idx = wiredEventTargets.indexOf(wiredEventTarget);
if (idx > -1) {
wiredEventTargets.splice(idx, 1);
}
});
const notifyStateChange = () => {
const state = store.getState();
eventTarget.dispatchEvent(new ValueChangedEvent(state));
};