UNPKG

@rikishi/watermelondb

Version:

Build powerful React Native and React web apps that scale from hundreds to tens of thousands of records and remain fast

19 lines (16 loc) 493 B
"use strict"; exports.__esModule = true; exports.default = doOnDispose; var _wmelonRxShim = require("../__wmelonRxShim"); // Performs an action when Observable is disposed; analogous to `Observable.do` function doOnDispose(onDispose) { return function (source) { return _wmelonRxShim.Observable.create(function (observer) { var subscription = source.subscribe(observer); return function () { subscription.unsubscribe(); onDispose(); }; }); }; }