(function (global, factory) {
  if (typeof define === "function" && define.amd) {
    define(["exports", "lodash/isNil", "rxjs/operators"], factory);
  } else if (typeof exports !== "undefined") {
    factory(exports, require("lodash/isNil"), require("rxjs/operators"));
  } else {
    var mod = {
      exports: {}
    };
    factory(mod.exports, global.isNil, global.operators);
    global.change = mod.exports;
  }
})(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports, _isNil, _operators) {
  "use strict";

  Object.defineProperty(_exports, "__esModule", {
    value: true
  });
  _exports.default = void 0;
  _isNil = _interopRequireDefault(_isNil);

  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

  function reducer([priorNum], nextNum) {
    if ((0, _isNil.default)(priorNum)) return [nextNum, null];
    return [nextNum, nextNum - priorNum];
  }

  const change = function change() {
    return source$ => source$.pipe((0, _operators.scan)(reducer, [null, null]), (0, _operators.map)(([, delta]) => delta), (0, _operators.filter)(delta => !(0, _isNil.default)(delta)));
  };

  var _default = change;
  _exports.default = _default;
});
//# sourceMappingURL=change.js.map