Skip to content
Craig Fowler edited this page Dec 9, 2018 · 9 revisions

Observable collections provides implementations of JavaScript/ECMAScript collection types which emit a stream of rxjs observable actions as the collections' contents are altered. The built-in collection types supported are Array, Set, Map, WeakSet & WeakMap.

Also available are two wrapper classes which augment WeakSet and WeakMap adding the ability to clear them and/or replace their contents in an observable manner.

Observable actions

All of these classes expose a common property, named actions. This property is an rxjs BehaviourSubject which emits an action object when the collection is constructed (its initial state) and also each time it is changed.

Architecture

Where supported by the environment, the observable implementations of the collection types subclass the built in collection types they supplement. The weak collection wrappers, on the other hand, do not subclass the built-in collections.

Browser/environment support

The source for this module is transpiled from modern ECMAScript and FlowJS types via Babel, allowing it to support a wide range of environments and browsers: the only requirement is that the environment supports at least ECMAScript 5. The target browser support profile covers more than 93% of browsers in global use, as of early December 2018. Explicitly supported browsers are:

  • Internet Explorer 9+
  • Chrome 55+
  • Firefox 50+
  • Safari 10+
  • Safari iOS 10+
  • Android Browser 4.4+ (KitKat onwards)
  • All versions of Edge