@nteract/epics
Version:
Redux-Observable epics for nteract apps
42 lines (41 loc) • 2.17 kB
TypeScript
import { Channels, ExecuteRequest } from "@nteract/messaging";
import { AnyAction } from "redux";
import { StateObservable } from "redux-observable";
import { Observable } from "rxjs";
import * as actions from "@nteract/actions";
import { AppState, ContentRef } from "@nteract/types";
/**
* Observe all the reactions to running code for cell with id.
*
* @param {Subject} channels - The standard channels specified in the Jupyter
* specification.
* @param {String} id - Universally Unique Identifier of cell to be executed.
* @param {String} code - Source code to be executed.
* @return {Observable<Action>} updatedOutputs - It returns an observable with
* a stream of events that need to happen after a cell has been executed.
*/
export declare function executeCellStream(channels: Channels, id: string, message: ExecuteRequest, contentRef: ContentRef): any;
/**
* A list of actions that indicate we probably want
* to stop executing the current cell.
*/
declare type PerCellStopStopExecutionActions = actions.ExecuteCanceled | actions.DeleteCell;
declare type ContentStopExecutionActions = actions.LaunchKernelAction | actions.LaunchKernelByNameAction | actions.InterruptKernel | actions.RestartKernel | actions.KillKernelAction;
declare type StopExecutionActions = PerCellStopStopExecutionActions | ContentStopExecutionActions;
declare type ExecuteStreamActions = StopExecutionActions | actions.SendExecuteRequest;
export declare function createExecuteCellStream(action$: Observable<ExecuteStreamActions>, channels: Channels, message: ExecuteRequest, id: string, contentRef: ContentRef): Observable<any>;
/**
* the send execute request epic processes execute requests for all cells,
* creating inner observable streams of the running execution responses
*/
export declare function sendExecuteRequestEpic(action$: Observable<actions.SendExecuteRequest>, state$: StateObservable<AppState>): Observable<{
type: "EXECUTE_FAILED";
payload: import("@nteract/actions/lib/utils").MaybeHasContent & {
id?: string | undefined;
} & {
error: Error;
code?: string | undefined;
};
error: true;
} | AnyAction>;
export {};