decord/source/13418_stateResponse.js

92 lines
2.9 KiB
JavaScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 13418
// Function ID: 103058
2026-07-20 16:05:17 +00:00
// Name: stateResponse
// Dependencies: []
2026-07-27 11:26:19 +00:00
// Module 13418 (stateResponse)
2026-07-20 16:05:17 +00:00
arg5.assertHasStateResponsePlugin = undefined;
arg5.default = undefined;
arg5.hasStateResponsePlugin = undefined;
arg5.default = function stateResponse() {
return (arg0) => {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
2026-07-20 16:05:17 +00:00
const features = {
stateActionComplete(name, action) {
2026-07-23 10:11:24 +00:00
return closure_0.send("state.action.complete", { name, action }, arguments.length > 2 && undefined !== arguments[2] && arguments[2]);
2026-07-20 16:05:17 +00:00
},
stateValuesResponse(path, value) {
const tmp = arguments.length > 2 && undefined !== arguments[2];
let tmp2 = !tmp;
if (tmp) {
tmp2 = arguments[2];
}
const obj = { path, value, valid: tmp2 };
2026-07-23 10:11:24 +00:00
return closure_0.send("state.values.response", obj);
2026-07-20 16:05:17 +00:00
},
stateKeysResponse(path, keys) {
const tmp = arguments.length > 2 && undefined !== arguments[2];
let tmp2 = !tmp;
if (tmp) {
tmp2 = arguments[2];
}
const obj = { path, keys, valid: tmp2 };
2026-07-23 10:11:24 +00:00
return closure_0.send("state.keys.response", obj);
2026-07-20 16:05:17 +00:00
},
stateValuesChange(changes) {
let sendResult = changes.length > 0;
if (sendResult) {
const obj = { changes };
2026-07-23 10:11:24 +00:00
sendResult = closure_0.send("state.values.change", obj);
2026-07-20 16:05:17 +00:00
}
return sendResult;
},
stateBackupResponse(state) {
2026-07-23 10:11:24 +00:00
return closure_0.send("state.backup.response", { state });
2026-07-20 16:05:17 +00:00
}
};
return { features };
};
};
function hasStateResponsePlugin(stateActionComplete) {
let tmp = stateActionComplete;
if (stateActionComplete) {
tmp = "stateActionComplete" in stateActionComplete;
}
if (tmp) {
tmp = "function" === typeof stateActionComplete.stateActionComplete;
}
if (tmp) {
tmp = "stateValuesResponse" in stateActionComplete;
}
if (tmp) {
tmp = "function" === typeof stateActionComplete.stateValuesResponse;
}
if (tmp) {
tmp = "stateKeysResponse" in stateActionComplete;
}
if (tmp) {
tmp = "function" === typeof stateActionComplete.stateKeysResponse;
}
if (tmp) {
tmp = "stateValuesChange" in stateActionComplete;
}
if (tmp) {
tmp = "function" === typeof stateActionComplete.stateValuesChange;
}
if (tmp) {
tmp = "stateBackupResponse" in stateActionComplete;
}
if (tmp) {
tmp = "function" === typeof stateActionComplete.stateBackupResponse;
}
return tmp;
}
arg5.hasStateResponsePlugin = hasStateResponsePlugin;
arg5.assertHasStateResponsePlugin = function assertHasStateResponsePlugin(stateActionComplete) {
if (!hasStateResponsePlugin(stateActionComplete)) {
const _Error = Error;
const error = new Error("This Reactotron client has not had the state responses plugin applied to it. Make sure that you add `use(stateResponse())` before adding this plugin.");
throw error;
}
};