Spaces:
Sleeping
Sleeping
Download src/context/WorkflowContext.jsx from markitzeroo/nodes-ui-flow: direct link, hf CLI and curl.
- Browser
- Download file 441 Bytes
-
https://huggingface.co/spaces/markitzeroo/nodes-ui-flow/resolve/main/src/context/WorkflowContext.jsx
- Command line
-
hf download hf://spaces/markitzeroo/nodes-ui-flow/src/context/WorkflowContext.jsx
-
curl -L -o WorkflowContext.jsx https://huggingface.co/spaces/markitzeroo/nodes-ui-flow/resolve/main/src/context/WorkflowContext.jsx
441 Bytes
| import { createContext, useContext } from 'react'; | |
| const WorkflowContext = createContext(null); | |
| export function WorkflowProvider({ value, children }) { | |
| return <WorkflowContext.Provider value={value}>{children}</WorkflowContext.Provider>; | |
| } | |
| export function useWorkflow() { | |
| const context = useContext(WorkflowContext); | |
| if (!context) { | |
| throw new Error('useWorkflow must be used inside WorkflowProvider'); | |
| } | |
| return context; | |
| } | |