mobx 6.5.0 → 6.6.0
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/CHANGELOG.md +6 -0
- package/README.md +1 -1
- package/dist/api/observable.d.ts +5 -1
- package/dist/mobx.cjs.development.js +15 -15
- package/dist/mobx.cjs.development.js.map +1 -1
- package/dist/mobx.cjs.production.min.js +1 -1
- package/dist/mobx.cjs.production.min.js.map +1 -1
- package/dist/mobx.esm.development.js +15 -15
- package/dist/mobx.esm.development.js.map +1 -1
- package/dist/mobx.esm.js +15 -15
- package/dist/mobx.esm.js.map +1 -1
- package/dist/mobx.esm.production.min.js +1 -1
- package/dist/mobx.esm.production.min.js.map +1 -1
- package/dist/mobx.umd.development.js +15 -15
- package/dist/mobx.umd.development.js.map +1 -1
- package/dist/mobx.umd.production.min.js +1 -1
- package/dist/mobx.umd.production.min.js.map +1 -1
- package/package.json +1 -1
- package/src/api/observable.ts +7 -2
- package/src/mobx.ts +1 -1
package/package.json
CHANGED
package/src/api/observable.ts
CHANGED
|
@@ -136,6 +136,11 @@ function createObservable(v: any, arg2?: any, arg3?: any) {
|
|
|
136
136
|
}
|
|
137
137
|
Object.assign(createObservable, observableDecoratorAnnotation)
|
|
138
138
|
|
|
139
|
+
export interface IObservableValueFactory {
|
|
140
|
+
<T>(value: T, options?: CreateObservableOptions): IObservableValue<T>
|
|
141
|
+
<T>(value?: T, options?: CreateObservableOptions): IObservableValue<T | undefined>
|
|
142
|
+
}
|
|
143
|
+
|
|
139
144
|
export interface IObservableFactory extends Annotation, PropertyDecorator {
|
|
140
145
|
<T = any>(value: T[], options?: CreateObservableOptions): IObservableArray<T>
|
|
141
146
|
<T = any>(value: Set<T>, options?: CreateObservableOptions): ObservableSet<T>
|
|
@@ -146,7 +151,7 @@ export interface IObservableFactory extends Annotation, PropertyDecorator {
|
|
|
146
151
|
options?: CreateObservableOptions
|
|
147
152
|
): T
|
|
148
153
|
|
|
149
|
-
box:
|
|
154
|
+
box: IObservableValueFactory
|
|
150
155
|
array: <T = any>(initialValues?: T[], options?: CreateObservableOptions) => IObservableArray<T>
|
|
151
156
|
set: <T = any>(
|
|
152
157
|
initialValues?: IObservableSetInitialValues<T>,
|
|
@@ -175,7 +180,7 @@ export interface IObservableFactory extends Annotation, PropertyDecorator {
|
|
|
175
180
|
}
|
|
176
181
|
|
|
177
182
|
const observableFactories: IObservableFactory = {
|
|
178
|
-
box<T = any>(value
|
|
183
|
+
box<T = any>(value: T, options?: CreateObservableOptions): IObservableValue<T> {
|
|
179
184
|
const o = asCreateObservableOptions(options)
|
|
180
185
|
return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals)
|
|
181
186
|
},
|
package/src/mobx.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* (c) Michel Weststrate 2015 - 2020
|
|
3
3
|
* MIT Licensed
|
|
4
4
|
*
|
|
5
|
-
* Welcome to the mobx sources! To get
|
|
5
|
+
* Welcome to the mobx sources! To get a global overview of how MobX internally works,
|
|
6
6
|
* this is a good place to start:
|
|
7
7
|
* https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74
|
|
8
8
|
*
|