Skip to content
Permalink
Browse files
Introduced isBoxedObservable, fixes #804
  • Loading branch information
mweststrate committed Mar 1, 2017
1 parent fd5658b commit a4e2b0e4532387a23e6a9c74743c1e00e9b6b4a8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
@@ -1,3 +1,7 @@
# 3.1.1

* Introduced `isBoxedObservable(value)`, fixes #804

# 3.1.0

### Improved strict mode
@@ -33,7 +33,7 @@ export { IInterceptable, IInterceptor } from "./types/in
export { IListenable } from "./types/listen-utils";
export { IObjectWillChange, IObjectChange, IObservableObject, isObservableObject } from "./types/observableobject";

export { IValueDidChange, IValueWillChange, IObservableValue } from "./types/observablevalue";
export { IValueDidChange, IValueWillChange, IObservableValue, isObservableValue as isBoxedObservable } from "./types/observablevalue";
export { IObservableArray, IArrayWillChange, IArrayWillSplice, IArrayChange, IArraySplice, isObservableArray } from "./types/observablearray";
export { IKeyValueMap, ObservableMap, IMapEntries, IMapEntry, IMapWillChange, IMapChange, isObservableMap, map, IObservableMapInitialValues, IMap } from "./types/observablemap";

@@ -25,6 +25,7 @@ test('correct api should be exposed', function(t) {
'intercept',
'isAction',
'isArrayLike',
'isBoxedObservable',
'isComputed',
'isModifierDescriptor',
'isObservable',
@@ -67,6 +67,16 @@ test('isObservable', function(t) {
t.end();
})

test('isBoxedObservable', function(t) {
t.equal(m.isBoxedObservable(m.observable({})), false);
t.equal(m.isBoxedObservable(m.computed(() => 3)), false);
t.equal(m.isBoxedObservable(m.observable(3)), true);
t.equal(m.isBoxedObservable(m.observable.box(3)), true);
t.equal(m.isBoxedObservable(m.observable.box({})), true);
t.equal(m.isBoxedObservable(m.observable.shallowBox({})), true);
t.end()
})

test('observable1', function(t) {
m.extras.resetGlobalState();

0 comments on commit a4e2b0e

Please sign in to comment.