Spaces:
Configuration error
Configuration error
Download frontend/src/state/jupyter-slice.ts from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 773 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/state/jupyter-slice.ts
- Command line
-
hf download hf://spaces/flyingdarkdev/README/frontend/src/state/jupyter-slice.ts
-
curl -L -o jupyter-slice.ts https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/state/jupyter-slice.ts
773 Bytes
| import { createSlice } from "@reduxjs/toolkit"; | |
| export type Cell = { | |
| content: string; | |
| type: "input" | "output"; | |
| }; | |
| const initialCells: Cell[] = []; | |
| export const jupyterSlice = createSlice({ | |
| name: "jupyter", | |
| initialState: { | |
| cells: initialCells, | |
| }, | |
| reducers: { | |
| appendJupyterInput: (state, action) => { | |
| state.cells.push({ content: action.payload, type: "input" }); | |
| }, | |
| appendJupyterOutput: (state, action) => { | |
| state.cells.push({ content: action.payload, type: "output" }); | |
| }, | |
| clearJupyter: (state) => { | |
| state.cells = []; | |
| }, | |
| }, | |
| }); | |
| export const { appendJupyterInput, appendJupyterOutput, clearJupyter } = | |
| jupyterSlice.actions; | |
| export const jupyterReducer = jupyterSlice.reducer; | |
| export default jupyterReducer; | |