(graphcache) - Implement Commutative Query Results (#565)
* Move optimistic layer creation to initDataState
* Move optimistic keys to main data structure
* Implement squashLayer and rename clearLayer
* Add commutative ordering handling to initDataState
* Add reserveLayer call for commutativity to cacheExchange
* Clean up squashData implementation
* Fix console.log not showing in tests
* Move squashing to clearDataState and fix squashing order
* Add key to write in cacheExchange and prevent clearing on queries
* Add initial ordering test
* Fix require path in benchmark
* Fix stopping condition for commutative layers in clearDataState
* Add additional commutativity tests to data.test.ts
* Fix noisy console.warn on double-spy
* Remove optimistic layer for commutative layers that aren't needed
When only one commutative layer exists then clean up all optimistic layers automatically
* Add changeset
* Add some additional comments
* Move layer creation from reserveLayer to initDataState
* Fix partially completed commutative chains
Previously when the lowest operation completed,
the entire commutative chain would be squashed
and deleted. Instead only the completed operations
until the next lowest uncompleted operation should
be squashed.
authored by