expect(dummy).toBe(3)
map.set('key2', 2)
expect(dummy).toBe(5)
+ // iteration should track mutation of existing entries (#709)
+ map.set('key1', 4)
+ expect(dummy).toBe(6)
map.delete('key1')
expect(dummy).toBe(2)
map.clear()
expect(dummy).toBe(3)
map.set('key2', 2)
expect(dummy).toBe(5)
+ // iteration should track mutation of existing entries (#709)
+ map.set('key1', 4)
+ expect(dummy).toBe(6)
map.delete('key1')
expect(dummy).toBe(2)
map.clear()
expect(dummy).toBe(3)
map.set('key2', 2)
expect(dummy).toBe(5)
+ // iteration should track mutation of existing entries (#709)
+ map.set('key1', 4)
+ expect(dummy).toBe(6)
map.delete('key1')
expect(dummy).toBe(2)
map.clear()
map.set('key2', 2)
expect(dummy).toBe('key1key2')
expect(dummy2).toBe(5)
+ // iteration should track mutation of existing entries (#709)
+ map.set('key1', 4)
+ expect(dummy).toBe('key1key2')
+ expect(dummy2).toBe(6)
map.delete('key1')
expect(dummy).toBe('key2')
expect(dummy2).toBe(2)
if (key !== void 0) {
addRunners(effects, computedRunners, depsMap.get(key))
}
- // also run for iteration key on ADD | DELETE
- if (type === TriggerOpTypes.ADD || type === TriggerOpTypes.DELETE) {
+ // also run for iteration key on ADD | DELETE | Map.SET
+ if (
+ type === TriggerOpTypes.ADD ||
+ type === TriggerOpTypes.DELETE ||
+ (type === TriggerOpTypes.SET && target instanceof Map)
+ ) {
const iterationKey = isArray(target) ? 'length' : ITERATE_KEY
addRunners(effects, computedRunners, depsMap.get(iterationKey))
}