mobx-vue-bridge 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -39
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,26 +59,7 @@ class UserPresenter {
|
|
|
59
59
|
// Option 1: Modern <script setup> syntax (recommended)
|
|
60
60
|
<script setup>
|
|
61
61
|
import { useMobxBridge } from 'mobx-vue-bridge'
|
|
62
|
-
import {
|
|
63
|
-
|
|
64
|
-
// Your MobX presenter
|
|
65
|
-
class UserPresenter {
|
|
66
|
-
constructor() {
|
|
67
|
-
this.name = 'John'
|
|
68
|
-
this.age = 25
|
|
69
|
-
this.emails = []
|
|
70
|
-
|
|
71
|
-
makeAutoObservable(this)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
get displayName() {
|
|
75
|
-
return `${this.name} (${this.age})`
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
addEmail(email) {
|
|
79
|
-
this.emails.push(email)
|
|
80
|
-
}
|
|
81
|
-
}
|
|
62
|
+
import { UserPresenter } from './presenters/UserPresenter.js'
|
|
82
63
|
|
|
83
64
|
const userPresenter = new UserPresenter()
|
|
84
65
|
|
|
@@ -89,25 +70,7 @@ const state = useMobxBridge(userPresenter)
|
|
|
89
70
|
// Option 2: Traditional Composition API
|
|
90
71
|
<script>
|
|
91
72
|
import { useMobxBridge } from 'mobx-vue-bridge'
|
|
92
|
-
import {
|
|
93
|
-
|
|
94
|
-
class UserPresenter {
|
|
95
|
-
constructor() {
|
|
96
|
-
this.name = 'John'
|
|
97
|
-
this.age = 25
|
|
98
|
-
this.emails = []
|
|
99
|
-
|
|
100
|
-
makeAutoObservable(this)
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
get displayName() {
|
|
104
|
-
return `${this.name} (${this.age})`
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
addEmail(email) {
|
|
108
|
-
this.emails.push(email)
|
|
109
|
-
}
|
|
110
|
-
}
|
|
73
|
+
import { UserPresenter } from './presenters/UserPresenter.js'
|
|
111
74
|
|
|
112
75
|
export default {
|
|
113
76
|
setup() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobx-vue-bridge",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A bridge between MobX observables and Vue 3 reactivity system, enabling seamless two-way data binding and state synchronization.",
|
|
5
5
|
"main": "src/mobxVueBridge.js",
|
|
6
6
|
"module": "src/mobxVueBridge.js",
|