3 ms·
With this one, the database is an immutable value, so you can hold on to old versions of it. Here's an incomplete example of how you could implement optimistic
by dwwoelfel 11y ago
With this one, the database is an immutable value, so you can hold on to old versions of it. Here's an incomplete example of how you could implement optimistic updates:
tx_report = datascript.transact(db_conn, [{:key "value"}]);
set_db_to_render_from(tx_report.db_after);
send_report_to_server(tx_report, function(error) {
set_db_to_render_from(tx.report.db_before);
});