Closed fiatjaf closed 7 years ago
back
needs to be an atom. Proxies are only like bi-directional
derivations.
On 27 Jul 2017 7:25 pm, "Giovanni T. Parra" notifications@github.com wrote:
const {proxy} = require('derivable') var back = [] let front = proxy({ get () { return back[0] }, set (v) { back.unshift(v) } }) front.react(f => console.log('FRONT:', f)) front.set(12)front.set('bababa')front.set(77778)
Shouldn't this code print FRONT: undefined, FRONT: 12, FRONT: bababa and FRONT: 77778? It only prints FRONT: undefined.
(Using 2.0.0-beta.0)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ds300/derivablejs/issues/69, or mute the thread https://github.com/notifications/unsubscribe-auth/ABL1qUzPw-ZsF75HRPheA5iUVMmGs7B4ks5sSNYTgaJpZM4Olqbv .
Thank you.
Shouldn't this code print
FRONT: undefined
,FRONT: 12
,FRONT: bababa
andFRONT: 77778
? It only printsFRONT: undefined
.The same code using a raw
atom
instead of a proxy produces the expected output.(Using
2.0.0-beta.0
)