Skip to content
Myr

fix: remove "function*" syntax

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Alec Larson · committed by Alec Larson · parent 3298a77 · Browse files · 1 file+18 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+18 added−8 removed

  • other:+18 added−8 removed

1 file+18 added−8 removed

modified:src/proxy.js+18 added-8 removed
244 unmodified lines
245function iterateMapValues(state, prop, receiver) {246 const getYieldable =247 prop === "values" ? (key, value) => value : (key, value) => [key, value]248249 return function*() {249 return () => {250 const iterator = source(state)[Symbol.iterator]()251 let result = iterator.next()252 while (!result.done) {253 const [key] = result.value254 const value = receiver.get(key)255 yield getYieldable(key, value)256 result = iterator.next()257 }251 return makeIterable(() => {252 const result = iterator.next()253 if (!result.done) {254 const [key] = result.value255 const value = receiver.get(key)256 result.value = getYieldable(key, value)257 }258 return result259 })260 }261}262263/**
22 unmodified lines
286 state.drafts = null287 if (state.parent) markChanged(state.parent)288 }289}290291function makeIterable(next) {292 let self293 return (self = {294 [Symbol.iterator]: () => self,295 next296 })297}