MCPcopy Create free account
hub / github.com/plotly/dash / getTriggeredId

Function getTriggeredId

dash/dash-renderer/src/actions/callbacks.ts:856–871  ·  view source on GitHub ↗
(triggered: string[])

Source from the content-addressed store, hash-verified

854}
855
856function getTriggeredId(triggered: string[]): string | object | undefined {
857 // for regular callbacks, takes the first triggered prop_id, e.g. "btn.n_clicks" and returns "btn"
858 // for pattern matching callback, e.g. '{"index":0, "type":"btn"}' and returns {index:0, type: "btn"}'
859 if (triggered && triggered.length) {
860 const trig = triggered[0];
861 let componentId;
862 if (trig.startsWith('{')) {
863 componentId = JSON.parse(
864 trig.substring(0, trig.lastIndexOf('}') + 1)
865 );
866 } else {
867 componentId = trig.split('.')[0];
868 }
869 return componentId;
870 }
871}
872
873export function executeCallback(
874 cb: IPrioritizedCallback,

Callers 1

handleClientsideFunction · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…