while(true) 的应用

function* watchAndLog(getState) {
while(true) {
const action = yield take('*')
console.log('action', action)
console.log('state after', getState())
})
}


fn = async () => {
while (true) {
await new Promise(res => setTimeout(res, 1000))
console.log(1)
}
}