MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / pureSendUpdate

Function pureSendUpdate

web/src/js/ducks/options.ts:54–72  ·  view source on GitHub ↗
(option: Option, value, dispatch)

Source from the content-addressed store, hash-verified

52export default optionsSlice.reducer;
53
54export async function pureSendUpdate(option: Option, value, dispatch) {
55 try {
56 const response = await fetchApi.put("/options", {
57 [option]: value,
58 });
59 if (response.status === 200) {
60 dispatch(optionsEditorActions.updateSuccess({ option }));
61 } else {
62 throw await response.text();
63 }
64 } catch (error) {
65 dispatch(
66 optionsEditorActions.updateError({
67 option,
68 error: error.toString(),
69 }),
70 );
71 }
72}
73
74const sendUpdate = pureSendUpdate; // _.throttle(pureSendUpdate, 500, {leading: true, trailing: true})
75

Callers

nothing calls this directly

Calls 4

dispatchFunction · 0.85
putMethod · 0.45
textMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…