graphprotocol / mutations

Apache License 2.0
4 stars 5 forks source link

Replace _rootSub With A Callback #6

Closed dOrgJelli closed 4 years ago

dOrgJelli commented 4 years ago

Investigate if we can replace _rootSub with a simple callback function.

dOrgJelli commented 4 years ago

If we did this, the implementation would become less straight forward, as we would have to create a strange pattern to effectively wrap our setState callbacks with subjects so we can subscribe to all of them at once for aggregate state update purposes: https://github.com/graphprotocol/mutations/blob/6752681679ff5b44fcba02b8bafa8c9bf32db3cc/packages/mutations/src/index.ts#L94-L103

Jannis commented 4 years ago

Agreed, I don't think there is a need to replace rootSubject with something that's not an observable.