@nozbe/watermelondb
Version:
Build powerful React Native and React web apps that scale from hundreds to tens of thousands of records and remain fast
18 lines (17 loc) • 511 B
JavaScript
;
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) {
// $FlowFixMe
var subscription = source.subscribe(observer);
return function () {
subscription.unsubscribe();
onDispose();
};
});
};
}