Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const url = `${websocketType}://${host}${port}/${query}`;
webUrl = `${httpType}://${host}${port}`;
channel = createChannel({
url,
async: onDeviceUI,
onError: () => {
this._setInitialStory(initialSelection, shouldPersistSelection);
},
});
}
addons.setChannel(channel);
this._stories.setChannel(channel);
channel.emit(Events.CHANNEL_CREATED);
}
channel.on(Events.GET_STORIES, () => this._sendSetStories());
channel.on(Events.SET_CURRENT_STORY, d => this._selectStoryEvent(d));
this._sendSetStories();
// eslint-disable-next-line @typescript-eslint/no-this-alias
const preview = this;
addons.loadAddons(this._clientApi);
const appliedTheme = { ...theme, ...params.theme };
// react-native hot module loader must take in a Class - https://github.com/facebook/react-native/issues/10991
return class StorybookRoot extends PureComponent {
constructor({ url: domain, options }) {
super();
const { secured, host, port } = options;
const websocketType = secured ? 'wss' : 'ws';
let url = `${websocketType}://${domain}`;
if (options.manualId) {
this.pairedId = uuid();
url += `/pairedId=${this.pairedId}`;
}
const channel = this.channel || createChannel({ url });
addons.setChannel(channel);
channel.emit(Events.CHANNEL_CREATED, {
host,
pairedId: this.pairedId,
port,
secured,
});
this.addons = addons;
this.channel = channel;
this.options = options;
}
constructor() {
super();
const channel = createChannel({ page: 'manager' });
addons.setChannel(channel);
channel.emit(Events.CHANNEL_CREATED);
this.addons = addons;
this.channel = channel;
}