({
queryEditor,
variableEditor,
headerEditor,
responseEditor,
defaultHeaders,
}: {
queryEditor: CodeMirrorEditorWithOperationFacts | null;
variableEditor: CodeMirrorEditor | null;
headerEditor: CodeMirrorEditor | null;
responseEditor: CodeMirrorEditor | null;
defaultHeaders?: string;
})
| 257 | } |
| 258 | |
| 259 | export function useSetEditorValues({ |
| 260 | queryEditor, |
| 261 | variableEditor, |
| 262 | headerEditor, |
| 263 | responseEditor, |
| 264 | defaultHeaders, |
| 265 | }: { |
| 266 | queryEditor: CodeMirrorEditorWithOperationFacts | null; |
| 267 | variableEditor: CodeMirrorEditor | null; |
| 268 | headerEditor: CodeMirrorEditor | null; |
| 269 | responseEditor: CodeMirrorEditor | null; |
| 270 | defaultHeaders?: string; |
| 271 | }) { |
| 272 | return useCallback( |
| 273 | ({ |
| 274 | query, |
| 275 | variables, |
| 276 | headers, |
| 277 | response, |
| 278 | }: { |
| 279 | query: string | null; |
| 280 | variables?: string | null; |
| 281 | headers?: string | null; |
| 282 | response: string | null; |
| 283 | }) => { |
| 284 | queryEditor?.setValue(query ?? ''); |
| 285 | variableEditor?.setValue(variables ?? ''); |
| 286 | headerEditor?.setValue(headers ?? defaultHeaders ?? ''); |
| 287 | responseEditor?.setValue(response ?? ''); |
| 288 | }, |
| 289 | [headerEditor, queryEditor, responseEditor, variableEditor, defaultHeaders], |
| 290 | ); |
| 291 | } |
| 292 | |
| 293 | export function createTab({ |
| 294 | query = null, |
no outgoing calls
no test coverage detected