September 2018
Intermediate to advanced
328 pages
9h 10m
English
Just as with Cook the Books, there's a class that wraps the Wasm interaction code and provides a clean interface. The contents of Transaction.js are very similar to the contents of /src/store/WasmTransactions.js from Cook the Books. Most of the changes accommodate for the categoryId being present in a transaction record and a single amount field (no more raw and cooked amounts). Additional functionality was added to interact with the database. For example, here's a function that edits an existing transaction, both in the database and the linked list from the Wasm instance:
getValidAmount(transaction) { const { amount, type } = transaction; return type === 'Withdrawal' ? -Math.abs(amount) : amount;}Read now
Unlock full access