ds300/derivablejs

add `transaction` function

ds300 opened this issue · 0 comments

Using havelock, I end up writing a lot of callbacks that look like:

function () {
  transact(function () {
    // do stuffs
  });
}

I could get rid of that extra nesting level by having a transaction function which takes a function f and returns a function which calls f in the context of a transaction.