September 2018
Intermediate to advanced
328 pages
9h 10m
English
The final section of code in the file initializes the store:
/** * This function instantiates the Wasm module, fetches the transactions * from the API endpoint, and loads them into state and the Wasm * instance. */export const initializeStore = async () => { const wasmTransactions = new WasmTransactions(); store.wasm = await wasmTransactions.initialize(); const transactions = await apiFetchTransactions(); store.populateTransactions(transactions);};
The initializeStore() function instantiates the Wasm module, fetches all transactions from the API, and populates the contents of state. This function is called from the application loading code in /src/main.js, which we'll cover in the next section.
Read now
Unlock full access