refactor: depend on scheduler directly in core instead of injecting via createRenderer
This commit is contained in:
@@ -11,3 +11,8 @@ The implementation of this module is inspired by the following prior art in the
|
||||
- [Meteor Tracker](https://docs.meteor.com/api/tracker.html)
|
||||
- [nx-js/observer-util](https://github.com/nx-js/observer-util)
|
||||
- [salesforce/observable-membrane](https://github.com/salesforce/observable-membrane)
|
||||
|
||||
|
||||
## Caveats
|
||||
|
||||
- Built-in objects are not observed except for `Map`, `WeakMap`, `Set` and `WeakSet`.
|
||||
|
||||
@@ -235,5 +235,15 @@ describe('observer/collections', () => {
|
||||
observed.get('key').a = 2
|
||||
expect(dummy).toBe(2)
|
||||
})
|
||||
|
||||
it('should observe iterated values (forEach)', () => {})
|
||||
|
||||
it('should observe iterated values (values)', () => {})
|
||||
|
||||
it('should observe iterated values (keys)', () => {})
|
||||
|
||||
it('should observe iterated values (entries)', () => {})
|
||||
|
||||
it('should observe iterated values (for...of)', () => {})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -158,6 +158,7 @@ const immutableInstrumentations: any = {
|
||||
const target = unwrap(this)
|
||||
const proto: any = Reflect.getPrototypeOf(target)
|
||||
track(target, OperationTypes.ITERATE)
|
||||
// TODO values retrived from iterations should also be observables
|
||||
return proto[method].apply(target, args)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user