mobx 6.12.5 → 6.13.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 +11 -5
- package/dist/mobx.cjs.development.js +232 -167
- 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 +232 -167
- package/dist/mobx.esm.development.js.map +1 -1
- package/dist/mobx.esm.js +232 -167
- 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 +232 -167
- 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/dist/types/observableset.d.ts +7 -0
- package/dist/utils/utils.d.ts +2 -2
- package/package.json +1 -1
- package/src/types/observableset.ts +48 -0
|
@@ -42,6 +42,13 @@ export declare class ObservableSet<T = any> implements Set<T>, IInterceptable<IS
|
|
|
42
42
|
entries(): IterableIterator<[T, T]>;
|
|
43
43
|
keys(): IterableIterator<T>;
|
|
44
44
|
values(): IterableIterator<T>;
|
|
45
|
+
intersection<U>(otherSet: ReadonlySetLike<U> | Set<U>): Set<T & U>;
|
|
46
|
+
union<U>(otherSet: ReadonlySetLike<U> | Set<U>): Set<T | U>;
|
|
47
|
+
difference<U>(otherSet: ReadonlySetLike<U>): Set<T>;
|
|
48
|
+
symmetricDifference<U>(otherSet: ReadonlySetLike<U> | Set<U>): Set<T | U>;
|
|
49
|
+
isSubsetOf(otherSet: ReadonlySetLike<unknown>): boolean;
|
|
50
|
+
isSupersetOf(otherSet: ReadonlySetLike<unknown>): boolean;
|
|
51
|
+
isDisjointFrom(otherSet: ReadonlySetLike<unknown> | Set<unknown>): boolean;
|
|
45
52
|
replace(other: ObservableSet<T> | IObservableSetInitialValues<T>): ObservableSet<T>;
|
|
46
53
|
observe_(listener: (changes: ISetDidChange<T>) => void, fireImmediately?: boolean): Lambda;
|
|
47
54
|
intercept_(handler: IInterceptor<ISetWillChange<T>>): Lambda;
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const assign: {
|
|
2
2
|
<T extends {}, U>(target: T, source: U): T & U;
|
|
3
|
-
<
|
|
4
|
-
<
|
|
3
|
+
<T extends {}, U, V>(target: T, source1: U, source2: V): T & U & V;
|
|
4
|
+
<T extends {}, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
|
|
5
5
|
(target: object, ...sources: any[]): any;
|
|
6
6
|
};
|
|
7
7
|
export declare const getDescriptor: (o: any, p: PropertyKey) => PropertyDescriptor | undefined;
|
package/package.json
CHANGED
|
@@ -243,6 +243,54 @@ export class ObservableSet<T = any> implements Set<T>, IInterceptable<ISetWillCh
|
|
|
243
243
|
} as any)
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
+
intersection<U>(otherSet: ReadonlySetLike<U> | Set<U>): Set<T & U> {
|
|
247
|
+
if (isES6Set(otherSet)) {
|
|
248
|
+
return otherSet.intersection(this)
|
|
249
|
+
} else {
|
|
250
|
+
const dehancedSet = new Set(this)
|
|
251
|
+
return dehancedSet.intersection(otherSet)
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
union<U>(otherSet: ReadonlySetLike<U> | Set<U>): Set<T | U> {
|
|
256
|
+
if (isES6Set(otherSet)) {
|
|
257
|
+
return otherSet.union(this)
|
|
258
|
+
} else {
|
|
259
|
+
const dehancedSet = new Set(this)
|
|
260
|
+
return dehancedSet.union(otherSet)
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
difference<U>(otherSet: ReadonlySetLike<U>): Set<T> {
|
|
265
|
+
return new Set(this).difference(otherSet)
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
symmetricDifference<U>(otherSet: ReadonlySetLike<U> | Set<U>): Set<T | U> {
|
|
269
|
+
if (isES6Set(otherSet)) {
|
|
270
|
+
return otherSet.symmetricDifference(this)
|
|
271
|
+
} else {
|
|
272
|
+
const dehancedSet = new Set(this)
|
|
273
|
+
return dehancedSet.symmetricDifference(otherSet)
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
isSubsetOf(otherSet: ReadonlySetLike<unknown>): boolean {
|
|
278
|
+
return new Set(this).isSubsetOf(otherSet)
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
isSupersetOf(otherSet: ReadonlySetLike<unknown>): boolean {
|
|
282
|
+
return new Set(this).isSupersetOf(otherSet)
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
isDisjointFrom(otherSet: ReadonlySetLike<unknown> | Set<unknown>): boolean {
|
|
286
|
+
if (isES6Set(otherSet)) {
|
|
287
|
+
return otherSet.isDisjointFrom(this)
|
|
288
|
+
} else {
|
|
289
|
+
const dehancedSet = new Set(this)
|
|
290
|
+
return dehancedSet.isDisjointFrom(otherSet)
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
246
294
|
replace(other: ObservableSet<T> | IObservableSetInitialValues<T>): ObservableSet<T> {
|
|
247
295
|
if (isObservableSet(other)) {
|
|
248
296
|
other = new Set(other)
|