MCPcopy
hub / github.com/JoelOtter/kajero / fetchData

Function fetchData

src/js/actions.js:149–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

147}
148
149export function fetchData() {
150 return (dispatch, getState) => {
151 let proms = [];
152 const currentData = getState().execution.get('data');
153 getState().notebook.getIn(['metadata', 'datasources']).forEach(
154 (url, name) => {
155 if (!currentData.has(name)) {
156 proms.push(
157 fetch(url, {
158 method: 'get'
159 })
160 .then(response => response.json())
161 .then(j => dispatch(receivedData(name, j)))
162 );
163 }
164 }
165 );
166 // When all data fetched, run all the auto-running code blocks.
167 return Promise.all(proms).then(() => dispatch(executeAuto()));
168 };
169}
170
171export function toggleEdit() {
172 return {

Callers 5

componentDidMountMethod · 0.90
updateSourceMethod · 0.90
addSourceMethod · 0.90
undoClickedMethod · 0.90
loadMarkdownFunction · 0.85

Calls 2

receivedDataFunction · 0.85
executeAutoFunction · 0.85

Tested by

no test coverage detected