textileio / js-threaddb

This project has been moved to https://github.com/textileio/js-textile
https://github.com/textileio/js-textile
MIT License
14 stars 1 forks source link

After state in changes middleware should be optimized #7

Open carsonfarmer opened 4 years ago

carsonfarmer commented 4 years ago

There are some suggestions in comments that should be explored. For example, we could just use undefined[] for deletes, and req.values for add/put if not we aren't waiting for auto-incrementing indexes to come back from IndexedDB (which, maybe we don't need to worry about because we're always using ulids?). If that is the case, then we can just always compute the :after: state using jsonpatch.applyPatch, or we could even just lazily compute the after state when we actually need them?