knockout / tko

🥊 Technical Knockout – The Monorepo for Knockout.js (4.0+)
http://www.tko.io
Other
273 stars 34 forks source link

Writable computed out of sync #182

Open bennieswart opened 1 year ago

bennieswart commented 1 year ago

Not sure if this is a bug or intended behaviour, but the following occurs in latest versions of both knockout and tko:

o = ko.observable()
c = ko.pureComputed({ read: o, write: o })
c.subscribe(() => o('c'))
c('o')
o() // 'c'
c() // 'o'

I would expect c() === o() always, since c() should always read the value of o().