mobxjs / mobx-vue

🐉 Vue bindings for MobX
MIT License
475 stars 22 forks source link

Doesn't appear to work with mobx-state-tree. Should it? #12

Closed pillowsoft closed 6 years ago

pillowsoft commented 6 years ago

I create two stores, one a mobx store and one a mobx-state-tree store. I then hooked them both up to a vue view, per the readme. The mobx store works (i.e component updates when the store changes), but the view does not update on changes in the mobx-state-tree store.

kuitos commented 6 years ago

Checked and it works well with my demo, could u give a codesandbox link to reproduce it?

pillowsoft commented 6 years ago

I could not get codesandbox to work (it had issues with multiple copies of mobx). Here's a repo that demos the issue: demo repo

kuitos commented 6 years ago

I had run a codesandbox demo to revalidate it and found nothing wrong. Could you check any thing I had missed? https://codesandbox.io/s/rjqr3pl34o

pillowsoft commented 6 years ago

Thanks! Yours works, but if you use a nested mst store, it breaks (at least for me).

Try this one with a nested mst store: https://codesandbox.io/s/x9qmzpkj84

I.e. the code is modifying the mst correctly, but re-renders are not happening on nested chnages.

On Fri, Jun 22, 2018 at 11:22 PM Kuitos notifications@github.com wrote:

I had run a codesandbox demo to revalidate it and found nothing wrong. Could you check any thing I had missed? https://codesandbox.io/s/rjqr3pl34o

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mobxjs/mobx-vue/issues/12#issuecomment-399626777, or mute the thread https://github.com/notifications/unsubscribe-auth/ACJCKs37lSNt82vyFu01xhp_iMM-pdHXks5t_bRwgaJpZM4UzAVT .

kuitos commented 6 years ago

With your codesandbox demo it worked well in my side, mst changes triggered. Anything I missed?

kapture 2018-06-24 at 17 47 07

pillowsoft commented 6 years ago

Egads, you're right. No sure what the heck I was doing, but it does indeed seem to be working now. So sorry for the confusion. Thank you and I owe you a drink!

On Sun, Jun 24, 2018 at 5:45 AM Kuitos notifications@github.com wrote:

With your codesandbox demo it worked well in my side, mst changes triggered. Could you please check it again?

[image: image] https://user-images.githubusercontent.com/5206843/41817874-38650ac0-77d6-11e8-9d1d-e36e79a36ba3.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mobxjs/mobx-vue/issues/12#issuecomment-399743501, or mute the thread https://github.com/notifications/unsubscribe-auth/ACJCKli8fZlLV08LtGDsTCm-sTgmZ97Fks5t_1-ggaJpZM4UzAVT .

kuitos commented 6 years ago

Never mind! Feel free to ask any questions!😀