Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const applyViewportOptions = (options = {}) => {
const channel = addons.getChannel();
handler = options.onViewportChange || noop;
if (options.onViewportChange) {
channel.emit(CoreEvents.REGISTER_SUBSCRIPTION, subscription);
}
channel.emit(SET_STORY_DEFAULT_VIEWPORT_EVENT_ID, options.name || DEFAULT_VIEWPORT);
};
const addEvents = ({ emit, events }) => {
if (prevEvents !== events) {
addons.getChannel().emit(EVENTS.ADD, events);
prevEvents = events;
}
currentEmit = emit;
addons.getChannel().emit(CoreEvents.REGISTER_SUBSCRIPTION, subscription);
};
const metaSubscription = () => {
addons.getChannel().on(Events.REGISTER_SUBSCRIPTION, subscriptionsStore.register);
return () =>
addons.getChannel().removeListener(Events.REGISTER_SUBSCRIPTION, subscriptionsStore.register);
};
const metaSubscription = () => {
addons.getChannel().on(Events.REGISTER_SUBSCRIPTION, metaSubscriptionHandler);
return () =>
addons.getChannel().removeListener(Events.REGISTER_SUBSCRIPTION, metaSubscriptionHandler);
};
return () =>
addons.getChannel().removeListener(Events.REGISTER_SUBSCRIPTION, metaSubscriptionHandler);
};
return () =>
addons.getChannel().removeListener(Events.REGISTER_SUBSCRIPTION, subscriptionsStore.register);
};
return () =>
addons.getChannel().removeListener(Events.REGISTER_SUBSCRIPTION, subscriptionsStore.register);
};
const metaSubscription = () => {
addons.getChannel().on(Events.REGISTER_SUBSCRIPTION, subscriptionsStore.register);
return () =>
addons.getChannel().removeListener(Events.REGISTER_SUBSCRIPTION, subscriptionsStore.register);
};