Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (
currentProps.kernelName !== kernelName ||
currentProps.cwd !== cwd ||
currentProps.host.endpoint !== endpoint ||
currentProps.host.token !== token
) {
console.log(
"Props changed while in the middle of starting a kernel, assuming that another kernel is starting up"
);
return {
channels: null,
error: true
};
}
return {
channels: kernels.connect(
host,
xhr.response.id
),
error: false
};
}
);
if (
currentProps.kernelName !== kernelName ||
currentProps.cwd !== cwd ||
currentProps.host.endpoint !== endpoint ||
currentProps.host.token !== token
) {
console.log(
"Props changed while in the middle of starting a kernel, assuming that another kernel is starting up"
);
return {
channels: null,
error: true
};
}
return {
channels: kernels.connect(host, xhr.response.id),
error: false
};
}
);
mergeMap(({ response: session }) => {
const kernel: RemoteKernelProps = Object.assign(
{},
session.kernel,
{
type: "websocket",
sessionId,
cwd,
channels: kernels.connect(
serverConfig,
session.kernel.id,
sessionId
),
kernelSpecName
}
);
return of(
actions.launchKernelSuccessful({
kernel,
kernelRef,
contentRef: action.payload.contentRef,
selectNextKernel: true
})
);
}),
mergeMap(data => {
const session = uuid();
const kernel = Object.assign({}, data.response, {
channel: kernels.connect(
config,
data.response.id,
session
)
});
kernel.channel.next(kernelInfoRequest());
return merge(
of(
actions.activateKernelFulfilled({
serverId,
kernelName,
kernel
})
)
mergeMap(({ response: session }) => {
const kernel: RemoteKernelProps = Object.assign(
{},
session.kernel,
{
type: "websocket",
sessionId,
cwd,
channels: kernels.connect(
serverConfig,
session.kernel.id,
sessionId
),
kernelSpecName
}
);
return of(
actions.launchKernelSuccessful({
kernel,
kernelRef,
contentRef: action.payload.contentRef,
selectNextKernel: true
})
);
}),
mergeMap(data => {
const session = data.response;
const sessionId = castToSessionId(session.id);
const kernel: RemoteKernelProps = Object.assign({}, session.kernel, {
type: "websocket",
info: null,
sessionId,
cwd,
channels: kernels.connect(
serverConfig,
session.kernel.id,
sessionId
),
kernelSpecName,
hostRef
});
kernel.channels.next(kernelInfoRequest());
return of(
actions.launchKernelSuccessful({
kernel,
kernelRef,
contentRef: action.payload.contentRef,
selectNextKernel: true
mergeMap(data => {
const session = data.response;
const sessionId = castToSessionId(session.id);
const kernel: RemoteKernelProps = Object.assign({}, session.kernel, {
type: "websocket",
info: null,
sessionId: sessionId,
cwd,
channels: kernels.connect(
serverConfig,
session.kernel.id,
sessionId
),
kernelSpecName
});
kernel.channels.next(kernelInfoRequest());
return of(
actions.launchKernelSuccessful({
kernel,
kernelRef,
contentRef: action.payload.contentRef,
selectNextKernel: true
})