MCPcopy Index your code
hub / github.com/plotly/dash / executeCallback

Function executeCallback

dash/dash-renderer/src/actions/callbacks.ts:873–1172  ·  view source on GitHub ↗
(
    cb: IPrioritizedCallback,
    config: any,
    hooks: any,
    paths: any,
    layout: any,
    {allOutputs}: any,
    dispatch: any,
    getState: any
)

Source from the content-addressed store, hash-verified

871}
872
873export function executeCallback(
874 cb: IPrioritizedCallback,
875 config: any,
876 hooks: any,
877 paths: any,
878 layout: any,
879 {allOutputs}: any,
880 dispatch: any,
881 getState: any
882): IExecutingCallback {
883 const {
884 output,
885 inputs,
886 state,
887 clientside_function,
888 background,
889 dynamic_creator
890 } = cb.callback;
891 try {
892 const inVals = fillVals(paths, layout, cb, inputs, 'Input', true);
893
894 /* Prevent callback if there's no inputs */
895 if (inVals === null) {
896 return {
897 ...cb,
898 executionPromise: null
899 };
900 }
901
902 const outputs: any[] = [];
903 const outputErrors: any[] = [];
904 allOutputs.forEach((out: any, i: number) => {
905 const [outi, erri] = unwrapIfNotMulti(
906 paths,
907 map(pick(['id', 'property']), out),
908 cb.callback.outputs[i],
909 cb.anyVals,
910 'Output'
911 );
912 outputs.push(outi);
913 if (erri) {
914 outputErrors.push(erri);
915 }
916 });
917
918 if (outputErrors.length) {
919 if (flatten(inVals).length) {
920 refErr(outputErrors, paths);
921 }
922 // This case is all-empty multivalued wildcard inputs,
923 // which we would normally fire the callback for, except
924 // some outputs are missing. So instead we treat it like
925 // regular missing inputs and just silently prevent it.
926 return {
927 ...cb,
928 executionPromise: null
929 };
930 }

Callers 1

Calls 5

fillValsFunction · 0.85
unwrapIfNotMultiFunction · 0.85
refErrFunction · 0.85
__executeFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…