mobx-vue-lite
mobx-vue-lite copied to clipboard
vue3 and composition api support is here !
https://github.com/mobxjs/mobx-vue/issues/60 [RFC] mobx-vue v3
I decided add vue3 support via mobx-vue-lite after consideration. mobx-vue current only support vue2 and mobx( v6 >= 2.1.* , v2|v3|v4|v5 < 2.1.0). @wobsoriano , Robert Soriano Thanks for youre great work for vue3 support, now you are mobxjs/mobx-vue-lite
project's maintainer , continue your great work please. 🚀
Thank you! Happy to be here.
So I imported the files from https://github.com/wobsoriano/mobx-vue-lite. Should we publish a new package?
No, mobx-vue-lite is ok. mobx-vue support vue2 and mobx-vue-lite support vue3. We don't need publish another new package. Please @ me if you need any help, thanks. ( Hope i am not misunderstanding your meaning
Okay. All good, thanks!
Very greate efforts! Thanks for everyone here. Really, I believe the future of state management in frontend is Simple Functional Component + Well Designed Domain Models (and the models, stores, services are driven by libs like mobx
.
import { useState } from "react"
import { observer, useLocalObservable } from "mobx-react-lite"
export default observer(() => {
const state = useLocalObservable(() => ({
count: 0,
get double() {
return this.count * 2
},
increment() {
this.count++
}
}))
//...
})
import { defineComponent } from 'vue'
import { useLocalObservable } from 'mobx-vue-lite'
export default defineComponent({
setup() {
const state = useLocalObservable(() => ({
count: 0,
get double() {
return this.count * 2
},
increment() {
this.count++
}
}))
return { state }
}
})
No, mobx-vue-lite is ok. mobx-vue support vue2 and mobx-vue-lite support vue3. We don't need publish another new package. Please @ me if you need any help, thanks. ( Hope i am not misunderstanding your meaning
@iChenLei
Could this libaray work with vue2.6 and [email protected] ?
The SourceCode seems to be very simple, but the import code maybe need be modified ?
Update: mobx-vue should can work with vue2.6 + @vue/composition-api according my analysis. I will update my conclusion after practice.