0

How to check if current javascript/typescript object is of type of ObservableArray ?

I tried doing typeof myObject but it returns me object.

I am using mobx store and one observable field of store has a array property which is resolved as ObservableArray.

Roshan
  • 873
  • 12
  • 33

1 Answers1

0

Mobx has exported isObservableArray function which will return true or false. Simple as that.

More info and other similar function here: https://mobx.js.org/refguide/api.html#isobservableobject-array-map-and-isboxedobservable

Danila
  • 15,606
  • 2
  • 35
  • 67