When dealing with the various abstractions in MobX (observables, actions, reactions), it is sometimes useful to know if a certain object, function, or value is of a certain kind. MobX has a set of isXXX APIs that help you to determine the type of the value:
- isObservableObject(thing), isObservableArray(thing), isObservableMap(thing): Tells you whether the passed in value is an observable object, array, or map
- isObservable(thing) and isObservableProp(thing, property?): Similar to the preceding point but more generalized check for an observable value
- isBoxedObservable(thing): Whether the value is a boxed observable
- isAction(func): Returns true if the function is wrapped by an action
- isComputed(thing) and isComputedProp(thing, ...