Comparing version 0.4.4 to 1.0.0
@@ -1,19 +0,14 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _set = require('babel-runtime/core-js/set'); | ||
var _set2 = _interopRequireDefault(_set); | ||
exports.default = filter; | ||
var _ = require('.'); | ||
var _ = _interopRequireDefault(require(".")); | ||
var _2 = _interopRequireDefault(_); | ||
/* eslint-disable no-unused-vars, no-redeclare */ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/*:: export default filter; */ | ||
@@ -23,6 +18,6 @@ | ||
function filter(liveSet, cb) { | ||
return new _2.default({ | ||
return new _.default({ | ||
scheduler: liveSet.getScheduler(), | ||
read: function read() { | ||
var ret = new _set2.default(); | ||
var ret = new Set(); | ||
liveSet.values().forEach(function (value) { | ||
@@ -36,7 +31,6 @@ if (cb(value)) { | ||
listen: function listen(setValues, controller) { | ||
var passedFilter = new _set2.default(); | ||
var passedFilter = new Set(); | ||
var sub = liveSet.subscribe({ | ||
start: function start() { | ||
var initialValues = new _set2.default(); | ||
var initialValues = new Set(); | ||
liveSet.values().forEach(function (value) { | ||
@@ -72,3 +66,2 @@ if (cb(value)) { | ||
}); | ||
return sub; | ||
@@ -80,5 +73,5 @@ } | ||
/* eslint-disable no-unused-vars, no-redeclare */ | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9maWx0ZXIuanMiXSwibmFtZXMiOlsiZmlsdGVyIiwibGl2ZVNldCIsImNiIiwiTGl2ZVNldCIsInNjaGVkdWxlciIsImdldFNjaGVkdWxlciIsInJlYWQiLCJyZXQiLCJ2YWx1ZXMiLCJmb3JFYWNoIiwidmFsdWUiLCJhZGQiLCJsaXN0ZW4iLCJzZXRWYWx1ZXMiLCJjb250cm9sbGVyIiwic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x1ZXMoKS5mb3JFYWNoKHZhbHVlID0+IHtcbiAgICAgICAgICAgIGlmIChjYih2YWx1ZSkpIHtcbiAgICAgICAgICAgICAgcGFzc2VkRmlsdGVyLmFkZCh2YWx1ZSk7XG4gICAgICAgICAgICAgIGluaXRpYWxWYWx1ZXMuYWRkKHZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgICBzZXRWYWx1ZXMoaW5pdGlhbFZhbHVlcyk7XG4gICAgICAgIH0sXG4gICAgICAgIG5leHQoY2hhbmdlcykge1xuICAgICAgICAgIGNoYW5nZXMuZm9yRWFjaChjaGFuZ2UgPT4ge1xuICAgICAgICAgICAgaWYgKGNoYW5nZS50eXBlID09PSAnYWRkJykge1xuICAgICAgICAgICAgICBpZiAoY2IoY2hhbmdlLnZhbHVlKSkge1xuICAgICAgICAgICAgICAgIHBhc3NlZEZpbHRlci5hZGQoY2hhbmdlLnZhbHVlKTtcbiAgICAgICAgICAgICAgICBjb250cm9sbGVyLmFkZChjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNoYW5nZS50eXBlID09PSAncmVtb3ZlJykge1xuICAgICAgICAgICAgICBpZiAocGFzc2VkRmlsdGVyLmhhcyhjaGFuZ2UudmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgcGFzc2VkRmlsdGVyLmRlbGV0ZShjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICAgIGNvbnRyb2xsZXIucmVtb3ZlKGNoYW5nZS52YWx1ZSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgZXJyb3IoZXJyKSB7XG4gICAgICAgICAgY29udHJvbGxlci5lcnJvcihlcnIpO1xuICAgICAgICB9LFxuICAgICAgICBjb21wbGV0ZSgpIHtcbiAgICAgICAgICBjb250cm9sbGVyLmVuZCgpO1xuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgcmV0dXJuIHN1YjtcbiAgICB9XG4gIH0pO1xufVxuLyo6OiBgICovXG4iXX0= | ||
module.exports = exports.default; | ||
module.exports.default = exports.default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9maWx0ZXIuanMiXSwibmFtZXMiOlsiZmlsdGVyIiwibGl2ZVNldCIsImNiIiwiTGl2ZVNldCIsInNjaGVkdWxlciIsImdldFNjaGVkdWxlciIsInJlYWQiLCJyZXQiLCJTZXQiLCJ2YWx1ZXMiLCJmb3JFYWNoIiwidmFsdWUiLCJhZGQiLCJsaXN0ZW4iLCJzZXRWYWx1ZXMiLCJjb250cm9sbGVyIiwicGFzc2VkRmlsdGVyIiwic3ViIiwic3Vic2NyaWJlIiwic3RhcnQiLCJpbml0aWFsVmFsdWVzIiwibmV4dCIsImNoYW5nZXMiLCJjaGFuZ2UiLCJ0eXBlIiwiaGFzIiwiZGVsZXRlIiwicmVtb3ZlIiwiZXJyb3IiLCJlcnIiLCJjb21wbGV0ZSIsImVuZCJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBR0E7O0FBRkE7O0FBT0E7O0FBRUE7QUFDZSxTQUFTQSxNQUFULENBQW1CQyxPQUFuQixFQUF3Q0MsRUFBeEMsRUFBMkU7QUFDeEYsU0FBTyxJQUFJQyxTQUFKLENBQVk7QUFDakJDLElBQUFBLFNBQVMsRUFBRUgsT0FBTyxDQUFDSSxZQUFSLEVBRE07QUFFakJDLElBQUFBLElBRmlCLGtCQUVWO0FBQ0wsVUFBTUMsR0FBRyxHQUFHLElBQUlDLEdBQUosRUFBWjtBQUNBUCxNQUFBQSxPQUFPLENBQUNRLE1BQVIsR0FBaUJDLE9BQWpCLENBQXlCLFVBQUFDLEtBQUssRUFBSTtBQUNoQyxZQUFJVCxFQUFFLENBQUNTLEtBQUQsQ0FBTixFQUFlO0FBQ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cbiAgICAgICAgfSxcbiAgICAgICAgbmV4dChjaGFuZ2VzKSB7XG4gICAgICAgICAgY2hhbmdlcy5mb3JFYWNoKGNoYW5nZSA9PiB7XG4gICAgICAgICAgICBpZiAoY2hhbmdlLnR5cGUgPT09ICdhZGQnKSB7XG4gICAgICAgICAgICAgIGlmIChjYihjaGFuZ2UudmFsdWUpKSB7XG4gICAgICAgICAgICAgICAgcGFzc2VkRmlsdGVyLmFkZChjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICAgIGNvbnRyb2xsZXIuYWRkKGNoYW5nZS52YWx1ZSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY2hhbmdlLnR5cGUgPT09ICdyZW1vdmUnKSB7XG4gICAgICAgICAgICAgIGlmIChwYXNzZWRGaWx0ZXIuaGFzKGNoYW5nZS52YWx1ZSkpIHtcbiAgICAgICAgICAgICAgICBwYXNzZWRGaWx0ZXIuZGVsZXRlKGNoYW5nZS52YWx1ZSk7XG4gICAgICAgICAgICAgICAgY29udHJvbGxlci5yZW1vdmUoY2hhbmdlLnZhbHVlKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBlcnJvcihlcnIpIHtcbiAgICAgICAgICBjb250cm9sbGVyLmVycm9yKGVycik7XG4gICAgICAgIH0sXG4gICAgICAgIGNvbXBsZXRlKCkge1xuICAgICAgICAgIGNvbnRyb2xsZXIuZW5kKCk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuXG4gICAgICByZXR1cm4gc3ViO1xuICAgIH1cbiAgfSk7XG59XG4vKjo6IGAgKi9cbiJdfQ== |
@@ -1,27 +0,15 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _map = require('babel-runtime/core-js/map'); | ||
var _map2 = _interopRequireDefault(_map); | ||
var _set = require('babel-runtime/core-js/set'); | ||
var _set2 = _interopRequireDefault(_set); | ||
exports.default = flatMap; | ||
var _ = require('.'); | ||
var _ = _interopRequireDefault(require(".")); | ||
var _2 = _interopRequireDefault(_); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function flatMap(liveSet, cb) { | ||
var isReading = false; | ||
return new _2.default({ | ||
return new _.default({ | ||
scheduler: liveSet.getScheduler(), | ||
@@ -32,4 +20,5 @@ read: function read() { | ||
} | ||
isReading = true; | ||
var s = new _set2.default(); | ||
var s = new Set(); | ||
liveSet.values().forEach(function (value) { | ||
@@ -47,3 +36,3 @@ var childSet = cb(value); | ||
var hasSubscribedToChildren = false; | ||
var childSetSubs = new _map2.default(); | ||
var childSetSubs = new Map(); | ||
@@ -78,2 +67,3 @@ function childSetSubscribe(childSet) { | ||
childSetSubs.delete(childSet); | ||
if (mainSubCompleted && childSetSubs.size === 0) { | ||
@@ -87,5 +77,4 @@ controller.end(); | ||
setValues(new _set2.default()); | ||
var childSets = new _map2.default(); | ||
setValues(new Set()); | ||
var childSets = new Map(); | ||
var mainSub = liveSet.subscribe({ | ||
@@ -108,8 +97,12 @@ start: function start() { | ||
var _childSet = childSets.get(change.value); | ||
if (!_childSet) throw new Error('removed value not in liveset'); | ||
_childSet.values().forEach(function (value) { | ||
controller.remove(value); | ||
}); | ||
childSets.delete(change.value); | ||
var childSetSub = childSetSubs.get(_childSet); | ||
if (childSetSub) { | ||
@@ -128,2 +121,3 @@ // We won't have the subscription if the childSet ended already | ||
mainSubCompleted = true; | ||
if (hasSubscribedToChildren && childSetSubs.size === 0) { | ||
@@ -134,3 +128,2 @@ controller.end(); | ||
}); | ||
return { | ||
@@ -156,3 +149,4 @@ unsubscribe: function unsubscribe() { | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9m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Y2hpbGRTZXQudmFsdWVzKCkuZm9yRWFjaCh2YWx1ZSA9PiB7XG4gICAgICAgICAgICAgICAgY29udHJvbGxlci5hZGQodmFsdWUpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBuZXh0KGNoYW5nZXMpIHtcbiAgICAgICAgICAgICAgY2hhbmdlcy5mb3JFYWNoKGNoYW5nZSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKGNoYW5nZS50eXBlID09PSAnYWRkJykge1xuICAgICAgICAgICAgICAgICAgY29udHJvbGxlci5hZGQoY2hhbmdlLnZhbHVlKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoYW5nZS50eXBlID09PSAncmVtb3ZlJykge1xuICAgICAgICAgICAgICAgICAgY29udHJvbGxlci5yZW1vdmUoY2hhbmdlLnZhbHVlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGVycm9yKGVycikge1xuICAgICAgICAgICAgICBjb250cm9sbGVyLmVycm9yKGVycik7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY29tcGxldGUoKSB7XG4gICAgICAgICAgICAgIGNoaWxkU2V0U3Vicy5kZWxldGUoY2hpbGRTZXQpO1xuICAgICAgICAgICAgICBpZiAobWFpblN1YkNvbXBsZXRlZCAmJiBjaGlsZFNldFN1YnMuc2l6ZSA9PT0gMCkge1xuICAgICAgICAgICAgICAgIGNvbnRyb2xsZXIuZW5kKCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBzZXRWYWx1ZXMobmV3IFNldCgpKTtcbiAgICAgIGNvbnN0IGNoaWxkU2V0czogTWFwPFQsIExpdmVTZXQ8VT4+ID0gbmV3IE1hcCgpO1xuXG4gICAgICBjb25zdCBtYWluU3ViID0gbGl2ZVNldC5zdWJzY3JpYmUoe1xuICAgICAgICBzdGFydCgpIHtcbiAgICAgICAgICBsaXZlU2V0LnZhbHVlcygpLmZvckVhY2godmFsdWUgPT4ge1xuICAgICAgICAgICAgY29uc3QgY2hpbGRTZXQgPSBjYih2YWx1ZSk7XG4gICAgICAgICAgICBjaGlsZFNldHMuc2V0KHZhbHVlLCBjaGlsZFNldCk7XG4gICAgICAgICAgICBjaGlsZFNldFN1YnNjcmliZShjaGlsZFNldCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgICAgaGFzU3Vic2NyaWJlZFRvQ2hpbGRyZW4gPSB0cnVlO1xuICAgICAgICB9LFxuICAgICAgICBuZXh0KGNoYW5nZXMpIHtcbiAgICAgICAgICBjaGFuZ2VzLmZvckVhY2goY2hhbmdlID0+IHtcbiAgICAgICAgICAgIGlmIChjaGFuZ2UudHlwZSA9PT0gJ2FkZCcpIHtcbiAgICAgICAgICAgICAgY29uc3QgY2hpbGRTZXQgPSBjYihjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICBjaGlsZFNldHMuc2V0KGNoYW5nZS52YWx1ZSwgY2hpbGRTZXQpO1xuICAgICAgICAgICAgICBjaGlsZFNldFN1YnNjcmliZShjaGlsZFNldCk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNoYW5nZS50eXBlID09PSAncmVtb3ZlJykge1xuICAgICAgICAgICAgICBjb25zdCBjaGlsZFNldCA9IGNoaWxkU2V0cy5nZXQoY2hhbmdlLnZhbHVlKTtcbiAgICAgICAgICAgICAgaWYgKCFjaGlsZFNldCkgdGhyb3cgbmV3IEVycm9yKCdyZW1vdmVkIHZhbHVlIG5vdCBpbiBsaXZlc2V0Jyk7XG4gICAgICAgICAgICAgIGNoaWxkU2V0LnZhbHVlcygpLmZvckVhY2godmFsdWUgPT4ge1xuICAgICAgICAgICAgICAgIGNvbnRyb2xsZXIucmVtb3ZlKHZhbHVlKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIGNoaWxkU2V0cy5kZWxldGUoY2hhbmdlLnZhbHVlKTtcbiAgICAgICAgICAgICAgY29uc3QgY2hpbGRTZXRTdWIgPSBjaGlsZFNldFN1YnMuZ2V0KGNoaWxkU2V0KTtcbiAgICAgICAgICAgICAgaWYgKGNoaWxkU2V0U3ViKSB7XG4gICAgICAgICAgICAgICAgLy8gV2Ugd29uJ3QgaGF2ZSB0aGUgc3Vic2NyaXB0aW9uIGlmIHRoZSBjaGlsZFNldCBlbmRlZCBhbHJlYWR5XG4gICAgICAgICAgICAgICAgY2hpbGRTZXRTdWIudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgICAgICBjaGlsZFNldFN1YnMuZGVsZXRlKGNoaWxkU2V0KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBlcnJvcihlcnIpIHtcbiAgICAgICAgICBjb250cm9sbGVyLmVycm9yKGVycik7XG4gICAgICAgIH0sXG4gICAgICAgIGNvbXBsZXRlKCkge1xuICAgICAgICAgIG1haW5TdWJDb21wbGV0ZWQgPSB0cnVlO1xuICAgICAgICAgIGlmIChoYXNTdWJzY3JpYmVkVG9DaGlsZHJlbiAmJiBjaGlsZFNldFN1YnMuc2l6ZSA9PT0gMCkge1xuICAgICAgICAgICAgY29udHJvbGxlci5lbmQoKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0pO1xuXG4gICAgICByZXR1cm4ge1xuICAgICAgICB1bnN1YnNjcmliZSgpIHtcbiAgICAgICAgICBtYWluU3ViLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgY2hpbGRTZXRTdWJzLmZvckVhY2goc3ViID0+IHtcbiAgICAgICAgICAgIHN1Yi51bnN1YnNjcmliZSgpO1xuICAgICAgICAgIH0pO1xuICAgICAgICAgIGNoaWxkU2V0cy5jbGVhcigpO1xuICAgICAgICAgIGNoaWxkU2V0U3Vicy5jbGVhcigpO1xuICAgICAgICB9LFxuICAgICAgICBwdWxsQ2hhbmdlcygpIHtcbiAgICAgICAgICBtYWluU3ViLnB1bGxDaGFuZ2VzKCk7XG4gICAgICAgICAgY2hpbGRTZXRTdWJzLmZvckVhY2goc3ViID0+IHtcbiAgICAgICAgICAgIHN1Yi5wdWxsQ2hhbmdlcygpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgIH1cbiAgfSk7XG59XG4iXX0= | ||
module.exports = exports.default; | ||
module.exports.default = exports.default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9mbGF0TWFwLmpzIl0sIm5hbWVzIjpbImZsYXRNYXAiLCJsaXZlU2V0IiwiY2IiLCJpc1JlYWRpbmciLCJMaXZlU2V0Iiwic2NoZWR1bGVyIiwiZ2V0U2NoZWR1bGVyIiwicmVhZCIsIkVycm9yIiwicyIsIlNldCIsInZhbHVlcyIsImZvckVhY2giLCJ2YWx1ZSIsImNoaWxkU2V0IiwiYWRkIiwibGlzdGVuIiwic2V0VmFsdWVzIiwiY29udHJvbGxlciIsIm1haW5TdWJDb21wbGV0ZWQiLCJoYXNTdWJzY3JpYmVkVG9DaGlsZHJlbiIsImNoaWxkU2V0U3VicyIsIk1hcCIsImNoaWxkU2V0U3Vic2NyaWJlIiwiaXNFbmRlZCIsInN1YnNjcmliZSIsInN0YXJ0Iiwic3ViIiwic2V0IiwibmV4dCIsImNoYW5nZXMiLCJjaGFuZ2UiLCJ0eXBlIiwicmVtb3ZlIiwiZXJyb3IiLCJlcnIiLCJjb21wbGV0ZSIsImRlbGV0ZSIsInNpemUiLCJlbmQiLCJjaGlsZFNldHMiLCJtYWluU3ViIiwiZ2V0IiwiY2hpbGRTZXRTdWIiLCJ1bnN1YnNjcmliZSIsImNsZWFyIiwicHVsbENoYW5nZXMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQUVBOztBQUdlLFNBQ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WJlKGNoaWxkU2V0OiBMaXZlU2V0PFU+KSB7XG4gICAgICAgIGlmIChjaGlsZFNldC5pc0VuZGVkKCkpIHsgLy8gb3B0aW1pemF0aW9uXG4gICAgICAgICAgY2hpbGRTZXQudmFsdWVzKCkuZm9yRWFjaCh2YWx1ZSA9PiB7XG4gICAgICAgICAgICBjb250cm9sbGVyLmFkZCh2YWx1ZSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgY2hpbGRTZXQuc3Vic2NyaWJlKHtcbiAgICAgICAgICAgIHN0YXJ0KHN1Yikge1xuICAgICAgICAgICAgICBjaGlsZFNldFN1YnMuc2V0KGNoaWxkU2V0LCBzdWIpO1xuICAgICAgICAgICAgICBjaGlsZFNldC52YWx1ZXMoKS5mb3JFYWNoKHZhbHVlID0+IHtcbiAgICAgICAgICAgICAgICBjb250cm9sbGVyLmFkZCh2YWx1ZSk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG5leHQoY2hhbmdlcykge1xuICAgICAgICAgICAgICBjaGFuZ2VzLmZvckVhY2goY2hhbmdlID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoY2hhbmdlLnR5cGUgPT09ICdhZGQnKSB7XG4gICAgICAgICAgICAgICAgICBjb250cm9sbGVyLmFkZChjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2hhbmdlLnR5cGUgPT09ICdyZW1vdmUnKSB7XG4gICAgICAgICAgICAgICAgICBjb250cm9sbGVyLnJlbW92ZShjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZXJyb3IoZXJyKSB7XG4gICAgICAgICAgICAgIGNvbnRyb2xsZXIuZXJyb3IoZXJyKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjb21wbGV0ZSgpIHtcbiAgICAgICAgICAgICAgY2hpbGRTZXRTdWJzLmRlbGV0ZShjaGlsZFNldCk7XG4gICAgICAgICAgICAgIGlmIChtYWluU3ViQ29tcGxldGVkICYmIGNoaWxkU2V0U3Vicy5zaXplID09PSAwKSB7XG4gICAgICAgICAgICAgICAgY29udHJvbGxlci5lbmQoKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIHNldFZhbHVlcyhuZXcgU2V0KCkpO1xuICAgICAgY29uc3QgY2hpbGRTZXRzOiBNYXA8VCwgTGl2ZVNldDxVPj4gPSBuZXcgTWFwKCk7XG5cbiAgICAgIGNvbnN0IG1haW5TdWIgPSBsaXZlU2V0LnN1YnNjcmliZSh7XG4gICAgICAgIHN0YXJ0KCkge1xuICAgICAgICAgIGxpdmVTZXQudmFsdWVzKCkuZm9yRWFjaCh2YWx1ZSA9PiB7XG4gICAgICAgICAgICBjb25zdCBjaGlsZFNldCA9IGNiKHZhbHVlKTtcbiAgICAgICAgICAgIGNoaWxkU2V0cy5zZXQodmFsdWUsIGNoaWxkU2V0KTtcbiAgICAgICAgICAgIGNoaWxkU2V0U3Vic2NyaWJlKGNoaWxkU2V0KTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgICBoYXNTdWJzY3JpYmVkVG9DaGlsZHJlbiA9IHRydWU7XG4gICAgICAgIH0sXG4gICAgICAgIG5leHQoY2hhbmdlcykge1xuICAgICAgICAgIGNoYW5nZXMuZm9yRWFjaChjaGFuZ2UgPT4ge1xuICAgICAgICAgICAgaWYgKGNoYW5nZS50eXBlID09PSAnYWRkJykge1xuICAgICAgICAgICAgICBjb25zdCBjaGlsZFNldCA9IGNiKGNoYW5nZS52YWx1ZSk7XG4gICAgICAgICAgICAgIGNoaWxkU2V0cy5zZXQoY2hhbmdlLnZhbHVlLCBjaGlsZFNldCk7XG4gICAgICAgICAgICAgIGNoaWxkU2V0U3Vic2NyaWJlKGNoaWxkU2V0KTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY2hhbmdlLnR5cGUgPT09ICdyZW1vdmUnKSB7XG4gICAgICAgICAgICAgIGNvbnN0IGNoaWxkU2V0ID0gY2hpbGRTZXRzLmdldChjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICBpZiAoIWNoaWxkU2V0KSB0aHJvdyBuZXcgRXJyb3IoJ3JlbW92ZWQgdmFsdWUgbm90IGluIGxpdmVzZXQnKTtcbiAgICAgICAgICAgICAgY2hpbGRTZXQudmFsdWVzKCkuZm9yRWFjaCh2YWx1ZSA9PiB7XG4gICAgICAgICAgICAgICAgY29udHJvbGxlci5yZW1vdmUodmFsdWUpO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgY2hpbGRTZXRzLmRlbGV0ZShjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICBjb25zdCBjaGlsZFNldFN1YiA9IGNoaWxkU2V0U3Vicy5nZXQoY2hpbGRTZXQpO1xuICAgICAgICAgICAgICBpZiAoY2hpbGRTZXRTdWIpIHtcbiAgICAgICAgICAgICAgICAvLyBXZSB3b24ndCBoYXZlIHRoZSBzdWJzY3JpcHRpb24gaWYgdGhlIGNoaWxkU2V0IGVuZGVkIGFscmVhZHlcbiAgICAgICAgICAgICAgICBjaGlsZFNldFN1Yi51bnN1YnNjcmliZSgpO1xuICAgICAgICAgICAgICAgIGNoaWxkU2V0U3Vicy5kZWxldGUoY2hpbGRTZXQpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIGVycm9yKGVycikge1xuICAgICAgICAgIGNvbnRyb2xsZXIuZXJyb3IoZXJyKTtcbiAgICAgICAgfSxcbiAgICAgICAgY29tcGxldGUoKSB7XG4gICAgICAgICAgbWFpblN1YkNvbXBsZXRlZCA9IHRydWU7XG4gICAgICAgICAgaWYgKGhhc1N1YnNjcmliZWRUb0NoaWxkcmVuICYmIGNoaWxkU2V0U3Vicy5zaXplID09PSAwKSB7XG4gICAgICAgICAgICBjb250cm9sbGVyLmVuZCgpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfSk7XG5cbiAgICAgIHJldHVybiB7XG4gICAgICAgIHVuc3Vic2NyaWJlKCkge1xuICAgICAgICAgIG1haW5TdWIudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICBjaGlsZFNldFN1YnMuZm9yRWFjaChzdWIgPT4ge1xuICAgICAgICAgICAgc3ViLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgICAgY2hpbGRTZXRzLmNsZWFyKCk7XG4gICAgICAgICAgY2hpbGRTZXRTdWJzLmNsZWFyKCk7XG4gICAgICAgIH0sXG4gICAgICAgIHB1bGxDaGFuZ2VzKCkge1xuICAgICAgICAgIG1haW5TdWIucHVsbENoYW5nZXMoKTtcbiAgICAgICAgICBjaGlsZFNldFN1YnMuZm9yRWFjaChzdWIgPT4ge1xuICAgICAgICAgICAgc3ViLnB1bGxDaGFuZ2VzKCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH07XG4gICAgfVxuICB9KTtcbn1cbiJdfQ== |
@@ -1,27 +0,15 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _map = require('babel-runtime/core-js/map'); | ||
var _map2 = _interopRequireDefault(_map); | ||
var _set = require('babel-runtime/core-js/set'); | ||
var _set2 = _interopRequireDefault(_set); | ||
exports.default = flatMapR; | ||
var _ = require('.'); | ||
var _ = _interopRequireDefault(require(".")); | ||
var _2 = _interopRequireDefault(_); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function flatMapR(liveSet, cb) { | ||
var isReading = false; | ||
return new _2.default({ | ||
return new _.default({ | ||
scheduler: liveSet.getScheduler(), | ||
@@ -32,4 +20,5 @@ read: function read() { | ||
} | ||
isReading = true; | ||
var s = new _set2.default(); | ||
var s = new Set(); | ||
liveSet.values().forEach(function (value) { | ||
@@ -48,3 +37,3 @@ var childSet = cb(value); | ||
var nextHasFired = false; | ||
var childSetSubs = new _map2.default(); | ||
var childSetSubs = new Map(); | ||
@@ -80,2 +69,3 @@ function childSetSubscribe(childSet) { | ||
childSetSubs.delete(childSet); | ||
if (mainSubCompleted && childSetSubs.size === 0) { | ||
@@ -89,5 +79,4 @@ controller.end(); | ||
setValues(new _set2.default()); | ||
var childSets = new _map2.default(); | ||
setValues(new Set()); | ||
var childSets = new Map(); | ||
var mainSub = liveSet.subscribe({ | ||
@@ -111,8 +100,12 @@ start: function start() { | ||
var _childSet = childSets.get(change.value); | ||
if (!_childSet) throw new Error('removed value not in liveset'); | ||
_childSet.values().forEach(function (value) { | ||
controller.remove(value); | ||
}); | ||
childSets.delete(change.value); | ||
var childSetSub = childSetSubs.get(_childSet); | ||
if (childSetSub) { | ||
@@ -131,2 +124,3 @@ // We won't have the subscription if the childSet ended already | ||
mainSubCompleted = true; | ||
if (hasSubscribedToChildren && childSetSubs.size === 0) { | ||
@@ -137,3 +131,2 @@ controller.end(); | ||
}); | ||
var isPullingChanges = false; | ||
@@ -168,3 +161,4 @@ return { | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9mbGF0TWFwUi5qcyJdLCJuYW1lcyI6WyJmbGF0TWFwUiIsImxpdmVTZXQiLCJjYiIsImlzUmVhZGluZyIsIkxpdmVTZXQiLCJzY2hlZHVsZXIiLCJnZXRTY2hlZHVsZXIiLCJyZWFkIiwiRXJyb3IiLCJzIiwidmFsdWVzIiwiZm9yRWFjaCIsImNoaWxkU2V0IiwidmFsdWUiLCJhZGQiLCJsaXN0ZW4iLCJzZXRWYWx1ZXMiLCJ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aWJlKHtcbiAgICAgICAgICAgIHN0YXJ0KHN1Yikge1xuICAgICAgICAgICAgICBjaGlsZFNldFN1YnMuc2V0KGNoaWxkU2V0LCBzdWIpO1xuICAgICAgICAgICAgICBjaGlsZFNldC52YWx1ZXMoKS5mb3JFYWNoKHZhbHVlID0+IHtcbiAgICAgICAgICAgICAgICBjb250cm9sbGVyLmFkZCh2YWx1ZSk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIG5leHQoY2hhbmdlcykge1xuICAgICAgICAgICAgICBuZXh0SGFzRmlyZWQgPSB0cnVlO1xuICAgICAgICAgICAgICBjaGFuZ2VzLmZvckVhY2goY2hhbmdlID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoY2hhbmdlLnR5cGUgPT09ICdhZGQnKSB7XG4gICAgICAgICAgICAgICAgICBjb250cm9sbGVyLmFkZChjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2hhbmdlLnR5cGUgPT09ICdyZW1vdmUnKSB7XG4gICAgICAgICAgICAgICAgICBjb250cm9sbGVyLnJlbW92ZShjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZXJyb3IoZXJyKSB7XG4gICAgICAgICAgICAgIGNvbnRyb2xsZXIuZXJyb3IoZXJyKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjb21wbGV0ZSgpIHtcbiAgICAgICAgICAgICAgY2hpbGRTZXRTdWJzLmRlbGV0ZShjaGlsZFNldCk7XG4gICAgICAgICAgICAgIGlmIChtYWluU3ViQ29tcGxldGVkICYmIGNoaWxkU2V0U3Vicy5zaXplID09PSAwKSB7XG4gICAgICAgICAgICAgICAgY29udHJvbGxlci5lbmQoKTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuIC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2hpbGRTZXQpIHRocm93IG5ldyBFcnJvcigncmVtb3ZlZCB2YWx1ZSBub3QgaW4gbGl2ZXNldCcpO1xuICAgICAgICAgICAgICBjaGlsZFNldC52YWx1ZXMoKS5mb3JFYWNoKHZhbHVlID0+IHtcbiAgICAgICAgICAgICAgICBjb250cm9sbGVyLnJlbW92ZSh2YWx1ZSk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICBjaGlsZFNldHMuZGVsZXRlKGNoYW5nZS52YWx1ZSk7XG4gICAgICAgICAgICAgIGNvbnN0IGNoaWxkU2V0U3ViID0gY2hpbGRTZXRTdWJzLmdldChjaGlsZFNldCk7XG4gICAgICAgICAgICAgIGlmIChjaGlsZFNldFN1Yikge1xuICAgICAgICAgICAgICAgIC8vIFdlIHdvbid0IGhhdmUgdGhlIHN1YnNjcmlwdGlvbiBpZiB0aGUgY2hpbGRTZXQgZW5kZWQgYWxyZWFkeVxuICAgICAgICAgICAgICAgIGNoaWxkU2V0U3ViLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgICAgICAgY2hpbGRTZXRTdWJzLmRlbGV0ZShjaGlsZFNldCk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgZXJyb3IoZXJyKSB7XG4gICAgICAgICAgY29udHJvbGxlci5lcnJvcihlcnIpO1xuICAgICAgICB9LFxuICAgICAgICBjb21wbGV0ZSgpIHtcbiAgICAgICAgICBtYWluU3ViQ29tcGxldGVkID0gdHJ1ZTtcbiAgICAgICAgICBpZiAoaGFzU3Vic2NyaWJlZFRvQ2hpbGRyZW4gJiYgY2hpbGRTZXRTdWJzLnNpemUgPT09IDApIHtcbiAgICAgICAgICAgIGNvbnRyb2xsZXIuZW5kKCk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgbGV0IGlzUHVsbGluZ0NoYW5nZXMgPSBmYWxzZTtcbiAgICAgIHJldHVybiB7XG4gICAgICAgIHVuc3Vic2NyaWJlKCkge1xuICAgICAgICAgIG1haW5TdWIudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICBjaGlsZFNldFN1YnMuZm9yRWFjaChzdWIgPT4ge1xuICAgICAgICAgICAgc3ViLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgICAgY2hpbGRTZXRzLmNsZWFyKCk7XG4gICAgICAgICAgY2hpbGRTZXRTdWJzLmNsZWFyKCk7XG4gICAgICAgIH0sXG4gICAgICAgIHB1bGxDaGFuZ2VzKCkge1xuICAgICAgICAgIGlmIChpc1B1bGxpbmdDaGFuZ2VzKSByZXR1cm47XG4gICAgICAgICAgaXNQdWxsaW5nQ2hhbmdlcyA9IHRydWU7XG5cbiAgICAgICAgICBkbyB7XG4gICAgICAgICAgICBuZXh0SGFzRmlyZWQgPSBmYWxzZTtcbiAgICAgICAgICAgIG1haW5TdWIucHVsbENoYW5nZXMoKTtcbiAgICAgICAgICAgIGNoaWxkU2V0U3Vicy5mb3JFYWNoKHN1YiA9PiB7XG4gICAgICAgICAgICAgIHN1Yi5wdWxsQ2hhbmdlcygpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSB3aGlsZSAobmV4dEhhc0ZpcmVkKTtcblxuICAgICAgICAgIGlzUHVsbGluZ0NoYW5nZXMgPSBmYWxzZTtcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICB9XG4gIH0pO1xufVxuIl19 | ||
module.exports = exports.default; | ||
module.exports.default = exports.default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9mbGF0TWFwUi5qcyJdLCJuYW1lcyI6WyJmbGF0TWFwUiIsImxpdmVTZXQiLCJjYiIsImlzUmVhZGluZyIsIkxpdmVTZXQiLCJzY2hlZHVsZXIiLCJnZXRTY2hlZHVsZXIiLCJyZWFkIiwiRXJyb3IiLCJ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U2V0LmlzRW5kZWQoKSkgeyAvLyBvcHRpbWl6YXRpb25cbiAgICAgICAgICBjaGlsZFNldC52YWx1ZXMoKS5mb3JFYWNoKHZhbHVlID0+IHtcbiAgICAgICAgICAgIGNvbnRyb2xsZXIuYWRkKHZhbHVlKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBjaGlsZFNldC5zdWJzY3JpYmUoe1xuICAgICAgICAgICAgc3RhcnQoc3ViKSB7XG4gICAgICAgICAgICAgIGNoaWxkU2V0U3Vicy5zZXQoY2hpbGRTZXQsIHN1Yik7XG4gICAgICAgICAgICAgIGNoaWxkU2V0LnZhbHVlcygpLmZvckVhY2godmFsdWUgPT4ge1xuICAgICAgICAgICAgICAgIGNvbnRyb2xsZXIuYWRkKHZhbHVlKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgbmV4dChjaGFuZ2VzKSB7XG4gICAgICAgICAgICAgIG5leHRIYXNGaXJlZCA9IHRydWU7XG4gICAgICAgICAgICAgIGNoYW5nZXMuZm9yRWFjaChjaGFuZ2UgPT4ge1xuICAgICAgICAgICAgICAgIGlmIChjaGFuZ2UudHlwZSA9PT0gJ2FkZCcpIHtcbiAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXIuYWRkKGNoYW5nZS52YWx1ZSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaGFuZ2UudHlwZSA9PT0gJ3JlbW92ZScpIHtcbiAgICAgICAgICAgICAgICAgIGNvbnRyb2xsZXIucmVtb3ZlKGNoYW5nZS52YWx1ZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBlcnJvcihlcnIpIHtcbiAgICAgICAgICAgICAgY29udHJvbGxlci5lcnJvcihlcnIpO1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNvbXBsZXRlKCkge1xu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hpbGRTZXQpO1xuICAgICAgICAgICAgICBjaGlsZFNldFN1YnNjcmliZShjaGlsZFNldCk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNoYW5nZS50eXBlID09PSAncmVtb3ZlJykge1xuICAgICAgICAgICAgICBjb25zdCBjaGlsZFNldCA9IGNoaWxkU2V0cy5nZXQoY2hhbmdlLnZhbHVlKTtcbiAgICAgICAgICAgICAgaWYgKCFjaGlsZFNldCkgdGhyb3cgbmV3IEVycm9yKCdyZW1vdmVkIHZhbHVlIG5vdCBpbiBsaXZlc2V0Jyk7XG4gICAgICAgICAgICAgIGNoaWxkU2V0LnZhbHVlcygpLmZvckVhY2godmFsdWUgPT4ge1xuICAgICAgICAgICAgICAgIGNvbnRyb2xsZXIucmVtb3ZlKHZhbHVlKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIGNoaWxkU2V0cy5kZWxldGUoY2hhbmdlLnZhbHVlKTtcbiAgICAgICAgICAgICAgY29uc3QgY2hpbGRTZXRTdWIgPSBjaGlsZFNldFN1YnMuZ2V0KGNoaWxkU2V0KTtcbiAgICAgICAgICAgICAgaWYgKGNoaWxkU2V0U3ViKSB7XG4gICAgICAgICAgICAgICAgLy8gV2Ugd29uJ3QgaGF2ZSB0aGUgc3Vic2NyaXB0aW9uIGlmIHRoZSBjaGlsZFNldCBlbmRlZCBhbHJlYWR5XG4gICAgICAgICAgICAgICAgY2hpbGRTZXRTdWIudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICAgICAgICBjaGlsZFNldFN1YnMuZGVsZXRlKGNoaWxkU2V0KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBlcnJvcihlcnIpIHtcbiAgICAgICAgICBjb250cm9sbGVyLmVycm9yKGVycik7XG4gICAgICAgIH0sXG4gICAgICAgIGNvbXBsZXRlKCkge1xuICAgICAgICAgIG1haW5TdWJDb21wbGV0ZWQgPSB0cnVlO1xuICAgICAgICAgIGlmIChoYXNTdWJzY3JpYmVkVG9DaGlsZHJlbiAmJiBjaGlsZFNldFN1YnMuc2l6ZSA9PT0gMCkge1xuICAgICAgICAgICAgY29udHJvbGxlci5lbmQoKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH0pO1xuXG4gICAgICBsZXQgaXNQdWxsaW5nQ2hhbmdlcyA9IGZhbHNlO1xuICAgICAgcmV0dXJuIHtcbiAgICAgICAgdW5zdWJzY3JpYmUoKSB7XG4gICAgICAgICAgbWFpblN1Yi51bnN1YnNjcmliZSgpO1xuICAgICAgICAgIGNoaWxkU2V0U3Vicy5mb3JFYWNoKHN1YiA9PiB7XG4gICAgICAgICAgICBzdWIudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgICBjaGlsZFNldHMuY2xlYXIoKTtcbiAgICAgICAgICBjaGlsZFNldFN1YnMuY2xlYXIoKTtcbiAgICAgICAgfSxcbiAgICAgICAgcHVsbENoYW5nZXMoKSB7XG4gICAgICAgICAgaWYgKGlzUHVsbGluZ0NoYW5nZXMpIHJldHVybjtcbiAgICAgICAgICBpc1B1bGxpbmdDaGFuZ2VzID0gdHJ1ZTtcblxuICAgICAgICAgIGRvIHtcbiAgICAgICAgICAgIG5leHRIYXNGaXJlZCA9IGZhbHNlO1xuICAgICAgICAgICAgbWFpblN1Yi5wdWxsQ2hhbmdlcygpO1xuICAgICAgICAgICAgY2hpbGRTZXRTdWJzLmZvckVhY2goc3ViID0+IHtcbiAgICAgICAgICAgICAgc3ViLnB1bGxDaGFuZ2VzKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9IHdoaWxlIChuZXh0SGFzRmlyZWQpO1xuXG4gICAgICAgICAgaXNQdWxsaW5nQ2hhbmdlcyA9IGZhbHNlO1xuICAgICAgICB9XG4gICAgICB9O1xuICAgIH1cbiAgfSk7XG59XG4iXX0= |
201
index.js
@@ -1,45 +0,38 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _set = require('babel-runtime/core-js/set'); | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _set2 = _interopRequireDefault(_set); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _Scheduler = _interopRequireDefault(require("./Scheduler")); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _symbolObservable = _interopRequireDefault(require("symbol-observable")); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _Scheduler = require('./Scheduler'); | ||
var _Scheduler2 = _interopRequireDefault(_Scheduler); | ||
var _symbolObservable = require('symbol-observable'); | ||
var _symbolObservable2 = _interopRequireDefault(_symbolObservable); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var LiveSet = function () { | ||
var LiveSet = | ||
/*#__PURE__*/ | ||
function () { | ||
// Whether we can mutate the _values Set. | ||
function LiveSet(init) { | ||
(0, _classCallCheck3.default)(this, LiveSet); | ||
this._values = null; | ||
this._mutableValues = false; | ||
this._active = null; | ||
this._inSubscriptionStart = false; | ||
this._ended = false; | ||
this._endedWithError = false; | ||
this._error = null; | ||
this._queuedCall = false; | ||
this._changeQueue = []; | ||
this._observers = []; | ||
(0, _classCallCheck2.default)(this, LiveSet); | ||
(0, _defineProperty2.default)(this, "_init", void 0); | ||
(0, _defineProperty2.default)(this, "_scheduler", void 0); | ||
(0, _defineProperty2.default)(this, "_values", null); | ||
(0, _defineProperty2.default)(this, "_mutableValues", false); | ||
(0, _defineProperty2.default)(this, "_active", null); | ||
(0, _defineProperty2.default)(this, "_inSubscriptionStart", false); | ||
(0, _defineProperty2.default)(this, "_ended", false); | ||
(0, _defineProperty2.default)(this, "_endedWithError", false); | ||
(0, _defineProperty2.default)(this, "_error", null); | ||
(0, _defineProperty2.default)(this, "_queuedCall", false); | ||
(0, _defineProperty2.default)(this, "_changeQueue", []); | ||
(0, _defineProperty2.default)(this, "_observers", []); | ||
this._init = init; | ||
@@ -49,4 +42,4 @@ this._scheduler = init.scheduler || LiveSet.defaultScheduler; | ||
(0, _createClass3.default)(LiveSet, [{ | ||
key: '_queueChange', | ||
(0, _createClass2.default)(LiveSet, [{ | ||
key: "_queueChange", | ||
value: function _queueChange(record) { | ||
@@ -58,4 +51,6 @@ var _this = this; | ||
} | ||
if (!this._queuedCall) { | ||
this._queuedCall = true; | ||
this._scheduler.schedule(function () { | ||
@@ -65,4 +60,5 @@ _this._queuedCall = false; | ||
_this._changeQueue = []; | ||
var observersToCall = void 0; | ||
var observersToCall; | ||
var ended = _this._ended; | ||
if (ended) { | ||
@@ -74,7 +70,8 @@ observersToCall = _this._observers; | ||
} | ||
observersToCall.forEach(function (record) { | ||
var observer = record.observer, | ||
ignore = record.ignore; | ||
var observerNext = observer.next; | ||
var observerNext = observer.next; | ||
if (observerNext) { | ||
@@ -86,2 +83,3 @@ if (ignore === 0) { | ||
var changesToDeliver = changes.slice(ignore); | ||
if (changesToDeliver.length) { | ||
@@ -92,2 +90,3 @@ observerNext.call(observer, changesToDeliver); | ||
} | ||
if (ended) { | ||
@@ -105,8 +104,8 @@ if (_this._endedWithError) { | ||
}, { | ||
key: '_deactivate', | ||
key: "_deactivate", | ||
value: function _deactivate() { | ||
if (!this._active) throw new Error('already inactive'); | ||
var listenHandler = this._active.listenHandler; | ||
this._active = null; | ||
this._active = null; | ||
if (listenHandler) { | ||
@@ -117,12 +116,13 @@ listenHandler.unsubscribe(); | ||
}, { | ||
key: 'values', | ||
key: "values", | ||
value: function values() { | ||
if (this._values) { | ||
if (this._active && !this._inSubscriptionStart) { | ||
var _listenHandler = this._active.listenHandler; | ||
var listenHandler = this._active.listenHandler; | ||
if (_listenHandler.pullChanges) { | ||
_listenHandler.pullChanges(); | ||
if (listenHandler.pullChanges) { | ||
listenHandler.pullChanges(); | ||
} | ||
} | ||
if (this._mutableValues) { | ||
@@ -133,2 +133,4 @@ this._mutableValues = false; | ||
/*:: if (!this._values) throw new Error(); */ | ||
return this._values; | ||
@@ -139,3 +141,5 @@ } else { | ||
} | ||
var s = this._init.read(); | ||
makeSetImmutable(s); | ||
@@ -146,3 +150,3 @@ return s; | ||
}, { | ||
key: 'isEnded', | ||
key: "isEnded", | ||
value: function isEnded() { | ||
@@ -152,3 +156,3 @@ return this._ended; | ||
}, { | ||
key: 'getScheduler', | ||
key: "getScheduler", | ||
value: function getScheduler() { | ||
@@ -158,3 +162,3 @@ return this._scheduler; | ||
}, { | ||
key: 'subscribe', | ||
key: "subscribe", | ||
value: function subscribe(observerOrOnNext, onError, onComplete) { | ||
@@ -164,4 +168,4 @@ var _this2 = this; | ||
var liveSet = this; | ||
var observer; | ||
var observer = void 0; | ||
if (typeof observerOrOnNext === 'function') { | ||
@@ -187,5 +191,7 @@ observer = { | ||
}; | ||
if (observer.start) { | ||
observer.start(_subscription); | ||
} | ||
if (!_subscription.closed) { | ||
@@ -202,2 +208,3 @@ if (this._endedWithError) { | ||
} | ||
_subscription.closed = true; | ||
@@ -207,11 +214,17 @@ return _subscription; | ||
var observerRecord = { observer: observer, ignore: this._changeQueue.length }; | ||
var observerRecord = { | ||
observer: observer, | ||
ignore: this._changeQueue.length | ||
}; | ||
var isStarting = true; | ||
var unsubscribedInStart = false; | ||
var subscription = { | ||
/*:: closed: false&&` */get closed() { | ||
/*:: closed: false&&` */ | ||
get closed() { | ||
return !isStarting && liveSet._observers.indexOf(observerRecord) < 0; | ||
} /*:: ` */ | ||
, unsubscribe: function unsubscribe() { | ||
} | ||
/*:: ` */ | ||
, | ||
unsubscribe: function unsubscribe() { | ||
if (isStarting) { | ||
@@ -221,7 +234,11 @@ unsubscribedInStart = true; | ||
} | ||
var ix = _this2._observers.indexOf(observerRecord); | ||
if (ix >= 0) { | ||
_this2._observers.splice(ix, 1); | ||
if (!_this2._ended && _this2._observers.length === 0) { | ||
_this2._values = null; | ||
_this2._deactivate(); | ||
@@ -235,6 +252,9 @@ } | ||
} | ||
var changeQueueLength = _this2._changeQueue.length; | ||
var originalNext = observer.next; | ||
if (changeQueueLength !== 0 && originalNext) { | ||
var changesToDeliver = _this2._changeQueue.slice(observerRecord.ignore); | ||
if (changesToDeliver.length !== 0) { | ||
@@ -251,15 +271,26 @@ observerRecord.ignore = changeQueueLength; | ||
// Flow doesn't support getters and setters yet | ||
/*:: closed: false&&` */get closed() { | ||
/*:: closed: false&&` */ | ||
get closed() { | ||
return !liveSet._active || liveSet._active.controller !== this; | ||
} /*:: ` */ | ||
, add: function add(value) { | ||
} | ||
/*:: ` */ | ||
, | ||
add: function add(value) { | ||
var values = _this2._values; | ||
if (!values) throw new Error('setValue must be called before controller is used'); | ||
if (!_this2._ended && !values.has(value)) { | ||
if (!_this2._mutableValues) { | ||
_this2._values = values = new _set2.default(values); | ||
_this2._values = values = new Set(values); | ||
_this2._mutableValues = true; | ||
} | ||
values.add(value); | ||
_this2._queueChange({ type: 'add', value: value }); | ||
_this2._queueChange({ | ||
type: 'add', | ||
value: value | ||
}); | ||
} | ||
@@ -270,9 +301,15 @@ }, | ||
if (!values) throw new Error('setValue must be called before controller is used'); | ||
if (!_this2._ended && values.has(value)) { | ||
if (!_this2._mutableValues) { | ||
_this2._values = values = new _set2.default(values); | ||
_this2._values = values = new Set(values); | ||
_this2._mutableValues = true; | ||
} | ||
values.delete(value); | ||
_this2._queueChange({ type: 'remove', value: value }); | ||
_this2._queueChange({ | ||
type: 'remove', | ||
value: value | ||
}); | ||
} | ||
@@ -285,3 +322,5 @@ }, | ||
_this2._error = err; | ||
_this2._queueChange(); | ||
_this2._deactivate(); | ||
@@ -292,3 +331,5 @@ }, | ||
_this2._ended = true; | ||
_this2._queueChange(); | ||
_this2._deactivate(); | ||
@@ -303,5 +344,7 @@ } | ||
}; | ||
var setValuesError = function setValuesError() { | ||
throw new Error('setValues must be called once during listen'); | ||
}; | ||
var _setValues2 = function _setValues(values) { | ||
@@ -313,8 +356,11 @@ _setValues2 = setValuesError; | ||
}; | ||
var listenHandlerOrFunction = this._init.listen(function (values) { | ||
return _setValues2(values); | ||
}, _controller2); | ||
if (!this._values) { | ||
setValuesError(); | ||
} | ||
if (typeof listenHandlerOrFunction === 'function') { | ||
@@ -329,4 +375,6 @@ active.listenHandler = { | ||
} | ||
if (_controller2.closed) { | ||
this._active = active; | ||
this._deactivate(); | ||
@@ -341,5 +389,6 @@ } | ||
} | ||
isStarting = false; | ||
observerRecord.ignore = this._changeQueue.length; | ||
observerRecord.ignore = this._changeQueue.length; | ||
if (!unsubscribedInStart) { | ||
@@ -352,8 +401,8 @@ this._observers.push(observerRecord); | ||
}], [{ | ||
key: 'active', | ||
key: "active", | ||
value: function active(initialValues, options) { | ||
var set = initialValues || new _set2.default(); | ||
var controller = void 0; | ||
var set = initialValues || new Set(); | ||
var controller; | ||
var liveSet = new LiveSet({ | ||
scheduler: options ? options.scheduler : null, | ||
scheduler: options ? options.scheduler : undefined, | ||
read: function read() { | ||
@@ -368,13 +417,18 @@ return set; | ||
liveSet.subscribe({}); | ||
return { liveSet: liveSet, controller: controller }; | ||
return { | ||
liveSet: liveSet, | ||
controller: controller | ||
}; | ||
} | ||
}, { | ||
key: 'constant', | ||
key: "constant", | ||
value: function constant(values, options) { | ||
makeSetImmutable(values); | ||
var shouldNotHappen = function shouldNotHappen() { | ||
throw new Error('Should not happen'); | ||
}; | ||
var ls = new LiveSet({ | ||
scheduler: options ? options.scheduler : null, | ||
scheduler: options ? options.scheduler : undefined, | ||
read: shouldNotHappen, | ||
@@ -390,11 +444,10 @@ listen: shouldNotHappen | ||
return LiveSet; | ||
}(); | ||
// Assign here because Flow doesn't support computed property keys on classes: | ||
}(); // Assign here because Flow doesn't support computed property keys on classes: | ||
// https://github.com/facebook/flow/issues/2286 | ||
LiveSet.defaultScheduler = new _Scheduler2.default(); | ||
exports.default = LiveSet; | ||
LiveSet.prototype[_symbolObservable2.default] = function () { | ||
(0, _defineProperty2.default)(LiveSet, "defaultScheduler", new _Scheduler.default()); | ||
LiveSet.prototype[_symbolObservable.default] = function () { | ||
return this; | ||
@@ -412,3 +465,5 @@ }; | ||
} | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJMaXZlU2V0IiwiaW5pdCIsIl92YWx1ZXMiLCJfbXV0YWJsZVZhbHVlcyIsIl9hY3RpdmUiLCJfaW5TdWJzY3JpcHRpb25TdGFydCIsIl9lbmRlZCIsIl9lbmRlZFdpdGhFcnJvciIsIl9lcnJvciIsIl9xdWV1ZWRDYWxsIiwiX2NoYW5nZVF1ZXVlIiwiX29ic2VydmVycyIsIl9pbml0IiwiX3NjaGVkdWxlciIsInNjaGVkdWxlciIsImRlZmF1bHRTY2hlZHVsZXIiLCJyZWNvcmQiLCJwdXNoIiwic2NoZWR1bGUiLCJjaGFuZ2VzIiwib2JzZXJ2ZXJzVG9DYWxsIiwiZW5kZWQiLCJzbGljZSIsImZvckVhY2giLCJvYnNlcnZlciIsImlnbm9yZSIsIm9ic2VydmVyTmV4dCIsIm5leHQiLCJjYWxsIiwiY2hhbmdlc1RvRGVsaXZlciIsImxlbmd0aCIsImVycm9yIiwiY29tcGxldGUiLCJFcnJvciIsImxpc3RlbkhhbmRsZXIiLCJ1bnN1YnNjcmliZSIsInB1bGxDaGFuZ2VzIiwibWFrZVNldEltbXV0YWJsZSIsInMiLCJyZWFkIiwib2JzZXJ2ZXJPck9uTmV4dCIsIm9uRXJyb3IiLCJvbkNvbXBsZXRlIiwibGl2ZVNldCIsInN1Yn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VydmFibGVdID0gZnVuY3Rpb24oKSB7XG4gIHJldHVybiB0aGlzO1xufTtcblxuZnVuY3Rpb24gbWFrZVNldEltbXV0YWJsZShzZXQ6IFNldDxhbnk+KSB7XG4gIGlmIChwcm9jZXNzLmVudi5OT0RFX0VOViAhPT0gJ3Byb2R1Y3Rpb24nKSB7XG4gICAgKHNldDphbnkpLmFkZCA9IChzZXQ6YW55KS5kZWxldGUgPSAoc2V0OmFueSkuY2xlYXIgPSByZWFkT25seTtcbiAgfVxufVxuXG5mdW5jdGlvbiByZWFkT25seSgpIHtcbiAgdGhyb3cgbmV3IEVycm9yKCdEbyBub3QgbW9kaWZ5IFNldCBwYXNzZWQgdG8gb3IgZnJvbSBMaXZlU2V0OiBTZXQgaXMgcmVhZC1vbmx5IGluIGRldmVsb3BtZW50Jyk7XG59XG4iXX0= |
35
map.js
@@ -1,28 +0,17 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _map = require('babel-runtime/core-js/map'); | ||
var _map2 = _interopRequireDefault(_map); | ||
var _set = require('babel-runtime/core-js/set'); | ||
var _set2 = _interopRequireDefault(_set); | ||
exports.default = map; | ||
var _ = require('.'); | ||
var _ = _interopRequireDefault(require(".")); | ||
var _2 = _interopRequireDefault(_); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function map(liveSet, cb) { | ||
return new _2.default({ | ||
return new _.default({ | ||
scheduler: liveSet.getScheduler(), | ||
read: function read() { | ||
var s = new _set2.default(); | ||
var s = new Set(); | ||
liveSet.values().forEach(function (value) { | ||
@@ -34,7 +23,6 @@ s.add(cb(value)); | ||
listen: function listen(setValues, controller) { | ||
var m = new _map2.default(); | ||
var m = new Map(); | ||
var sub = liveSet.subscribe({ | ||
start: function start() { | ||
var s = new _set2.default(); | ||
var s = new Set(); | ||
liveSet.values().forEach(function (value) { | ||
@@ -55,2 +43,3 @@ var newValue = cb(value); | ||
var _newValue = m.get(change.value); | ||
if (!_newValue) throw new Error('removed item not in liveset'); | ||
@@ -69,3 +58,2 @@ m.delete(change.value); | ||
}); | ||
return sub; | ||
@@ -76,3 +64,4 @@ } | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9tYXAuanMiXSwibmFtZXMiOlsibWFwIiwibGl2ZVNldCIsImNiIiwiTGl2ZVNldCIsInNjaGVkdWxlciIsImdldFNjaGVkdWxlciIsInJlYWQiLCJzIiwidmFsdWVzIiwiZm9yRWFjaCIsImFkZCIsInZhbHVlIiwibGlzdGVuIiwic2V0VmFsdWVzIiwiY29udHJvbGxlciIsIm0iLCJzdWIiLCJzdWJzY3JpYmUiLCJzdGFydCIsIm5ld1ZhbHVlIiwic2V0IiwibmV4dCIsImNoYW5nZXMiLCJjaGFuZ2UiLCJ0eXBlIiwiZ2V0IiwiRXJyb3IiLCJkZWxldGUiLCJyZW1vdmUiLCJlcnJvciIsImVyciIsImNvbXBsZXRlIiwiZW5kIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztrQkFJd0JBLEc7O0FBRnhCOzs7Ozs7QUFFZSxTQUFTQSxHQUFULENBQWtCQyxPQUFsQixFQUF1Q0MsRUFBdkMsRUFBd0U7QUFDckYsU0FBTyxJQUFJQyxVQUFKLENBQVk7QUFDakJDLGVBQVdILFFBQVFJLFlBQVIsRUFETTtBQUVqQkMsUUFGaUIsa0JBRVY7QUFDTCxVQUFNQyxJQUFJLG1CQUFWO0FBQ0FOLGNBQVFPLE1BQVIsR0FBaUJDLE9BQWpCLENBQXlCLGlCQUFTO0FBQ2hDRixVQUFFRyxHQUFGLENBQU1SLEdBQUdTLEtBQUgsQ0FBTjtBQUNELE9BRkQ7QUFHQSxhQUFPSixDQUFQO0FBQ0QsS0FSZ0I7QUFTakJLLFV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Wx1ZSA9PiB7XG4gICAgICAgICAgICBjb25zdCBuZXdWYWx1ZSA9IGNiKHZhbHVlKTtcbiAgICAgICAgICAgIG0uc2V0KHZhbHVlLCBuZXdWYWx1ZSk7XG4gICAgICAgICAgICBzLmFkZChuZXdWYWx1ZSk7XG4gICAgICAgICAgfSk7XG4gICAgICAgICAgc2V0VmFsdWVzKHMpO1xuICAgICAgICB9LFxuICAgICAgICBuZXh0KGNoYW5nZXMpIHtcbiAgICAgICAgICBjaGFuZ2VzLmZvckVhY2goY2hhbmdlID0+IHtcbiAgICAgICAgICAgIGlmIChjaGFuZ2UudHlwZSA9PT0gJ2FkZCcpIHtcbiAgICAgICAgICAgICAgY29uc3QgbmV3VmFsdWUgPSBjYihjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICBtLnNldChjaGFuZ2UudmFsdWUsIG5ld1ZhbHVlKTtcbiAgICAgICAgICAgICAgY29udHJvbGxlci5hZGQobmV3VmFsdWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChjaGFuZ2UudHlwZSA9PT0gJ3JlbW92ZScpIHtcbiAgICAgICAgICAgICAgY29uc3QgbmV3VmFsdWUgPSBtLmdldChjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICBpZiAoIW5ld1ZhbHVlKSB0aHJvdyBuZXcgRXJyb3IoJ3JlbW92ZWQgaXRlbSBub3QgaW4gbGl2ZXNldCcpO1xuICAgICAgICAgICAgICBtLmRlbGV0ZShjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICBjb250cm9sbGVyLnJlbW92ZShuZXdWYWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIGVycm9yKGVycikge1xuICAgICAgICAgIGNvbnRyb2xsZXIuZXJyb3IoZXJyKTtcbiAgICAgICAgfSxcbiAgICAgICAgY29tcGxldGUoKSB7XG4gICAgICAgICAgY29udHJvbGxlci5lbmQoKTtcbiAgICAgICAgfVxuICAgICAgfSk7XG5cbiAgICAgIHJldHVybiBzdWI7XG4gICAgfVxuICB9KTtcbn1cbiJdfQ== | ||
module.exports = exports.default; | ||
module.exports.default = exports.default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9tYXAuanMiXSwibmFtZXMiOlsibWFwIiwibGl2ZVNldCIsImNiIiwiTGl2ZVNldCIsInNjaGVkdWxlciIsImdldFNjaGVkdWxlciIsInJlYWQiLCJzIiwiU2V0IiwidmFsdWVzIiwiZm9yRWFjaCIsInZhbHVlIiwiYWRkIiwibGlzdGVuIiwic2V0VmFsdWVzIiwiY29udHJvbGxlciIsIm0iLCJNYXAiLCJzdWIiLCJzdWJzY3JpYmUiLCJzdGFydCIsIm5ld1ZhbHVlIiwic2V0IiwibmV4dCIsImNoYW5nZXMiLCJjaGFuZ2UiLCJ0eXBlIiwiZ2V0IiwiRXJyb3IiLCJkZWxldGUiLCJyZW1vdmUiLCJlcnJvciIsImVyciIsImNvbXBsZXRlIiwiZW5kIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFFQTs7QUFFZSxTQUFTQSxHQUFULENBQWtCQyxPQUFsQixFQUF1Q0MsRUFBdkMsRUFBd0U7QUFDckYsU0FBTyxJQUFJQyxTQUFKLENBQVk7QUFDakJDLElBQUFBLFNBQVMsRUFBRUgsT0FBTyxDQUFDSSxZQUFSLEVBRE07QUFFakJDLElBQUFBLElBRmlCLGtCQUVWO0FBQ0wsVUFBTUMsQ0FBQyxHQUFHLElBQUlDLEdBQUosRUFBVjtBQUNBUCxNQUFBQSxPQUFPLENBQUNRLE1BQVIsR0FBaUJDLE9BQWpCLENBQXlCLFVBQUFDLEtBQUssRUFBSTtBQUNoQ0osUUFBQUEsQ0FBQyxDQUFDSyxHQUFGLENBQU1WLEVBQUUsQ0FBQ1MsS0FBRCxDQUFSO0FBQ0QsT0FGRDtBQUdBLGFBQU9KLENBQVA7QUF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vckVhY2godmFsdWUgPT4ge1xuICAgICAgICBzLmFkZChjYih2YWx1ZSkpO1xuICAgICAgfSk7XG4gICAgICByZXR1cm4gcztcbiAgICB9LFxuICAgIGxpc3RlbihzZXRWYWx1ZXMsIGNvbnRyb2xsZXIpIHtcbiAgICAgIGNvbnN0IG06IE1hcDxULFU+ID0gbmV3IE1hcCgpO1xuXG4gICAgICBjb25zdCBzdWIgPSBsaXZlU2V0LnN1YnNjcmliZSh7XG4gICAgICAgIHN0YXJ0KCkge1xuICAgICAgICAgIGNvbnN0IHMgPSBuZXcgU2V0KCk7XG4gICAgICAgICAgbGl2ZVNldC52YWx1ZXMoKS5mb3JFYWNoKHZhbHVlID0+IHtcbiAgICAgICAgICAgIGNvbnN0IG5ld1ZhbHVlID0gY2IodmFsdWUpO1xuICAgICAgICAgICAgbS5zZXQodmFsdWUsIG5ld1ZhbHVlKTtcbiAgICAgICAgICAgIHMuYWRkKG5ld1ZhbHVlKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgICBzZXRWYWx1ZXMocyk7XG4gICAgICAgIH0sXG4gICAgICAgIG5leHQoY2hhbmdlcykge1xuICAgICAgICAgIGNoYW5nZXMuZm9yRWFjaChjaGFuZ2UgPT4ge1xuICAgICAgICAgICAgaWYgKGNoYW5nZS50eXBlID09PSAnYWRkJykge1xuICAgICAgICAgICAgICBjb25zdCBuZXdWYWx1ZSA9IGNiKGNoYW5nZS52YWx1ZSk7XG4gICAgICAgICAgICAgIG0uc2V0KGNoYW5nZS52YWx1ZSwgbmV3VmFsdWUpO1xuICAgICAgICAgICAgICBjb250cm9sbGVyLmFkZChuZXdWYWx1ZSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNoYW5nZS50eXBlID09PSAncmVtb3ZlJykge1xuICAgICAgICAgICAgICBjb25zdCBuZXdWYWx1ZSA9IG0uZ2V0KGNoYW5nZS52YWx1ZSk7XG4gICAgICAgICAgICAgIGlmICghbmV3VmFsdWUpIHRocm93IG5ldyBFcnJvcigncmVtb3ZlZCBpdGVtIG5vdCBpbiBsaXZlc2V0Jyk7XG4gICAgICAgICAgICAgIG0uZGVsZXRlKGNoYW5nZS52YWx1ZSk7XG4gICAgICAgICAgICAgIGNvbnRyb2xsZXIucmVtb3ZlKG5ld1ZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgZXJyb3IoZXJyKSB7XG4gICAgICAgICAgY29udHJvbGxlci5lcnJvcihlcnIpO1xuICAgICAgICB9LFxuICAgICAgICBjb21wbGV0ZSgpIHtcbiAgICAgICAgICBjb250cm9sbGVyLmVuZCgpO1xuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgcmV0dXJuIHN1YjtcbiAgICB9XG4gIH0pO1xufVxuIl19 |
@@ -1,29 +0,14 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _promise = require('babel-runtime/core-js/promise'); | ||
var _promise2 = _interopRequireDefault(_promise); | ||
var _set = require('babel-runtime/core-js/set'); | ||
var _set2 = _interopRequireDefault(_set); | ||
var _map = require('babel-runtime/core-js/map'); | ||
var _map2 = _interopRequireDefault(_map); | ||
exports.default = mapWithRemoval; | ||
var _ = require('.'); | ||
var _ = _interopRequireDefault(require(".")); | ||
var _2 = _interopRequireDefault(_); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function mapWithRemoval(input, cb) { | ||
var output = new _2.default({ | ||
var output = new _.default({ | ||
scheduler: input.getScheduler(), | ||
@@ -34,15 +19,18 @@ read: function read() { | ||
listen: function listen(setValues, controller) { | ||
var m = new _map2.default(); | ||
var m = new Map(); | ||
var sub = input.subscribe({ | ||
start: function start() { | ||
var s = new _set2.default(); | ||
var s = new Set(); | ||
input.values().forEach(function (value) { | ||
var resolve = void 0; | ||
var removal = new _promise2.default(function (_resolve) { | ||
var resolve; | ||
var removal = new Promise(function (_resolve) { | ||
resolve = _resolve; | ||
}); | ||
/*:: if (!resolve) throw new Error(); */ | ||
var newValue = cb(value, removal); | ||
m.set(value, { newValue: newValue, resolve: resolve }); | ||
m.set(value, { | ||
newValue: newValue, | ||
resolve: resolve | ||
}); | ||
s.add(newValue); | ||
@@ -55,19 +43,26 @@ }); | ||
if (change.type === 'add') { | ||
var _resolve2 = void 0; | ||
var _removal = new _promise2.default(function (_resolve) { | ||
_resolve2 = _resolve; | ||
var resolve; | ||
var _removal = new Promise(function (_resolve) { | ||
resolve = _resolve; | ||
}); | ||
/*:: if (!resolve) throw new Error(); */ | ||
var _newValue = cb(change.value, _removal); | ||
m.set(change.value, { newValue: _newValue, resolve: _resolve2 }); | ||
controller.add(_newValue); | ||
var newValue = cb(change.value, _removal); | ||
m.set(change.value, { | ||
newValue: newValue, | ||
resolve: resolve | ||
}); | ||
controller.add(newValue); | ||
} else if (change.type === 'remove') { | ||
var entry = m.get(change.value); | ||
if (!entry) throw new Error('removed item not in liveset'); | ||
var _newValue2 = entry.newValue, | ||
_resolve3 = entry.resolve; | ||
var _newValue = entry.newValue, | ||
_resolve2 = entry.resolve; | ||
_resolve3(); | ||
_resolve2(); | ||
m.delete(change.value); | ||
controller.remove(_newValue2); | ||
controller.remove(_newValue); | ||
} | ||
@@ -83,3 +78,2 @@ }); | ||
}); | ||
return { | ||
@@ -90,3 +84,2 @@ unsubscribe: function unsubscribe() { | ||
var resolve = _ref.resolve; | ||
resolve(); | ||
@@ -104,3 +97,4 @@ }); | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9tYXBXaXRoUmVtb3ZhbC5qcyJdLCJuYW1lcyI6WyJtYXBXaXRoUmVtb3ZhbCIsImlucHV0IiwiY2IiLCJvdXRwdXQiLCJMaXZlU2V0Iiwic2NoZWR1bGVyIiwiZ2V0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wbGV0ZSgpIHtcbiAgICAgICAgICBjb250cm9sbGVyLmVuZCgpO1xuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgICAgcmV0dXJuIHtcbiAgICAgICAgdW5zdWJzY3JpYmUoKSB7XG4gICAgICAgICAgc3ViLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgbS5mb3JFYWNoKCh7cmVzb2x2ZX0pID0+IHtcbiAgICAgICAgICAgIHJlc29sdmUoKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgcHVsbENoYW5nZXMoKSB7XG4gICAgICAgICAgc3ViLnB1bGxDaGFuZ2VzKCk7XG4gICAgICAgIH1cbiAgICAgIH07XG4gICAgfVxuICB9KTtcbiAgcmV0dXJuIG91dHB1dDtcbn1cbiJdfQ== | ||
module.exports = exports.default; | ||
module.exports.default = exports.default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9tYXBXaXRoUmVtb3ZhbC5qcyJdLCJuYW1lcyI6WyJtYXBXaXRoUmVtb3ZhbCIsImlucHV0IiwiY2IiLCJvdXRwdXQiLCJMaXZlU2V0Iiwic2NoZWR1bGVyIiwiZ2V0U2NoZWR1bGVyIiwicmVhZCIsIkVycm9yIiwibGlzdGVuIiwic2V0VmFsdWVzIiwiY29udHJvbGxlciIsIm0iLCJNYXAiLCJzdWIiLCJzdWJzY3JpYmUiLCJzdGFydCIsInMiLCJTZXQiLCJ2YWx1ZXMiLCJmb3JFYWNoIiwidmFsdWUiLCJyZXNvbHZlIiwicmVtb3ZhbCIsIlByb21pc2UiLCJfcmVzb2x2ZSIsIm5ld1ZhbHVlIiwic2V0IiwiYWRkIiwibmV4dCIsImNoYW5nZXMiLCJjaGFuZ2UiLCJ0eXBlIiwiZW50cnkiLCJnZXQiLCJkZWxldGUiLCJyZW1vdmUiLCJlcnJvciIsImVyciIsImNvbXBsZXRlIiwiZW5kIiwidW5zdWJzY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biAgICAgICAgICAgIHMuYWRkKG5ld1ZhbHVlKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgICBzZXRWYWx1ZXMocyk7XG4gICAgICAgIH0sXG4gICAgICAgIG5leHQoY2hhbmdlcykge1xuICAgICAgICAgIGNoYW5nZXMuZm9yRWFjaChjaGFuZ2UgPT4ge1xuICAgICAgICAgICAgaWYgKGNoYW5nZS50eXBlID09PSAnYWRkJykge1xuICAgICAgICAgICAgICBsZXQgcmVzb2x2ZTtcbiAgICAgICAgICAgICAgY29uc3QgcmVtb3ZhbDogUHJvbWlzZTx2b2lkPiA9IG5ldyBQcm9taXNlKF9yZXNvbHZlID0+IHtcbiAgICAgICAgICAgICAgICByZXNvbHZlID0gX3Jlc29sdmU7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAvKjo6IGlmICghcmVzb2x2ZSkgdGhyb3cgbmV3IEVycm9yKCk7ICovXG4gICAgICAgICAgICAgIGNvbnN0IG5ld1ZhbHVlID0gY2IoY2hhbmdlLnZhbHVlLCByZW1vdmFsKTtcbiAgICAgICAgICAgICAgbS5zZXQoY2hhbmdlLnZhbHVlLCB7bmV3VmFsdWUsIHJlc29sdmV9KTtcbiAgICAgICAgICAgICAgY29udHJvbGxlci5hZGQobmV3VmFsdWUpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChjaGFuZ2UudHlwZSA9PT0gJ3JlbW92ZScpIHtcbiAgICAgICAgICAgICAgY29uc3QgZW50cnkgPSBtLmdldChjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICBpZiAoIWVudHJ5KSB0aHJvdyBuZXcgRXJyb3IoJ3JlbW92ZWQgaXRlbSBub3QgaW4gbGl2ZXNldCcpO1xuICAgICAgICAgICAgICBjb25zdCB7bmV3VmFsdWUsIHJlc29sdmV9ID0gZW50cnk7XG4gICAgICAgICAgICAgIHJlc29sdmUoKTtcbiAgICAgICAgICAgICAgbS5kZWxldGUoY2hhbmdlLnZhbHVlKTtcbiAgICAgICAgICAgICAgY29udHJvbGxlci5yZW1vdmUobmV3VmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBlcnJvcihlcnIpIHtcbiAgICAgICAgICBjb250cm9sbGVyLmVycm9yKGVycik7XG4gICAgICAgIH0sXG4gICAgICAgIGNvbXBsZXRlKCkge1xuICAgICAgICAgIGNvbnRyb2xsZXIuZW5kKCk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuXG4gICAgICByZXR1cm4ge1xuICAgICAgICB1bnN1YnNjcmliZSgpIHtcbiAgICAgICAgICBzdWIudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICBtLmZvckVhY2goKHtyZXNvbHZlfSkgPT4ge1xuICAgICAgICAgICAgcmVzb2x2ZSgpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuICAgICAgICBwdWxsQ2hhbmdlcygpIHtcbiAgICAgICAgICBzdWIucHVsbENoYW5nZXMoKTtcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICB9XG4gIH0pO1xuICByZXR1cm4gb3V0cHV0O1xufVxuIl19 |
37
merge.js
@@ -1,24 +0,17 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _set = require('babel-runtime/core-js/set'); | ||
var _set2 = _interopRequireDefault(_set); | ||
exports.default = merge; | ||
var _ = require('.'); | ||
var _ = _interopRequireDefault(require(".")); | ||
var _2 = _interopRequireDefault(_); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function merge(liveSets) { | ||
return new _2.default({ | ||
scheduler: liveSets[0] ? liveSets[0].getScheduler() : null, | ||
return new _.default({ | ||
scheduler: liveSets[0] ? liveSets[0].getScheduler() : undefined, | ||
read: function read() { | ||
var s = new _set2.default(); | ||
var s = new Set(); | ||
liveSets.forEach(function (liveSet) { | ||
@@ -32,7 +25,7 @@ liveSet.values().forEach(function (value) { | ||
listen: function listen(setValues, controller) { | ||
var initialValues = new _set2.default(); | ||
var subs = new _set2.default(); | ||
var initialValues = new Set(); | ||
var subs = new Set(); | ||
var doneSubscribing = false; | ||
liveSets.forEach(function (liveSet) { | ||
var sub = void 0; | ||
var sub; | ||
liveSet.subscribe({ | ||
@@ -60,2 +53,3 @@ start: function start(_sub) { | ||
subs.delete(sub); | ||
if (doneSubscribing && subs.size === 0) { | ||
@@ -67,9 +61,9 @@ controller.end(); | ||
}); | ||
setValues(initialValues); | ||
doneSubscribing = true; | ||
doneSubscribing = true; | ||
if (subs.size === 0) { | ||
controller.end(); | ||
} | ||
return { | ||
@@ -91,3 +85,4 @@ unsubscribe: function unsubscribe() { | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9tZXJnZS5qcyJdLCJuYW1lcyI6WyJtZXJnZSIsImxpdmVTZXRzIiwiTGl2ZVNldCIsInNjaGVkdWxlciIsImdldFNjaGVkdWxlciIsInJlYWQiLCJzIiwiZm9yRWFjaCIsImxpdmVTZXQiLCJ2YWx1ZXMiLCJhZGQiLCJ2YWx1ZSIsImxpc3RlbiIsInNldFZhbHVlcyIsImNvbnRyb2xsZXIiLCJpbml0aWFsVmFsdWVzIiwic3VicyIsImRvbmVTdWJzY3JpYmluZyIsInN1YiIsInN1YnNjcmliZSIsInN0YXJ0IiwiX3N1YiIsIm5leHQiLCJjaGFuZ2VzIiwiY2hhbmdlIiwidHlwZSIsInJlbW92ZSIsImVycm9yIiwiZXJyIiwiY29tcGxldGUiLCJkZWxldGUiLCJzaXplIiwiZW5kIiwidW5zdWJzY3JpYmUiLCJwdWxsQ2hhbmdlcyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztrQkFJd0JBLEs7O0FBRnhCOzs7Ozs7QUFFZSxTQUFTQSxLQUFUL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KGNoYW5nZSA9PiB7XG4gICAgICAgICAgICAgIGlmIChjaGFuZ2UudHlwZSA9PT0gJ2FkZCcpIHtcbiAgICAgICAgICAgICAgICBjb250cm9sbGVyLmFkZChjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICB9IGVsc2UgaWYgKGNoYW5nZS50eXBlID09PSAncmVtb3ZlJykge1xuICAgICAgICAgICAgICAgIGNvbnRyb2xsZXIucmVtb3ZlKGNoYW5nZS52YWx1ZSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgZXJyb3IoZXJyKSB7XG4gICAgICAgICAgICBjb250cm9sbGVyLmVycm9yKGVycik7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBjb21wbGV0ZSgpIHtcbiAgICAgICAgICAgIHN1YnMuZGVsZXRlKHN1Yik7XG4gICAgICAgICAgICBpZiAoZG9uZVN1YnNjcmliaW5nICYmIHN1YnMuc2l6ZSA9PT0gMCkge1xuICAgICAgICAgICAgICBjb250cm9sbGVyLmVuZCgpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICB9KTtcblxuICAgICAgc2V0VmFsdWVzKGluaXRpYWxWYWx1ZXMpO1xuXG4gICAgICBkb25lU3Vic2NyaWJpbmcgPSB0cnVlO1xuICAgICAgaWYgKHN1YnMuc2l6ZSA9PT0gMCkge1xuICAgICAgICBjb250cm9sbGVyLmVuZCgpO1xuICAgICAgfVxuICAgICAgcmV0dXJuIHtcbiAgICAgICAgdW5zdWJzY3JpYmUoKSB7XG4gICAgICAgICAgc3Vicy5mb3JFYWNoKHN1YiA9PiB7XG4gICAgICAgICAgICBzdWIudW5zdWJzY3JpYmUoKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgcHVsbENoYW5nZXMoKSB7XG4gICAgICAgICAgc3Vicy5mb3JFYWNoKHN1YiA9PiB7XG4gICAgICAgICAgICBzdWIucHVsbENoYW5nZXMoKTtcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfTtcbiAgICB9XG4gIH0pO1xufVxuIl19 | ||
module.exports = exports.default; | ||
module.exports.default = exports.default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9tZXJnZS5qcyJdLCJuYW1lcyI6WyJtZXJnZSIsImxpdmVTZXRzIiwiTGl2ZVNldCIsInNjaGVkdWxlciIsImdldFNjaGVkdWxlciIsInVuZGVmaW5lZCIsInJlYWQiLCJzIiwiU2V0IiwiZm9yRWFjaCIsImxpdmVTZXQiLCJ2YWx1ZXMiLCJ2YWx1ZSIsImFkZCIsImxpc3RlbiIsInNldFZhbHVlcyIsImNvbnRyb2xsZXIiLCJpbml0aWFsVmFsdWVzIiwic3VicyIsImRvbmVTdWJzY3JpYmluZyIsInN1YiIsInN1YnNjcmliZSIsInN0YXJ0IiwiX3N1YiIsIm5leHQiLCJjaGFuZ2VzIiwiY2hhbmdlIiwidHlwZSIsInJlbW92ZSIsImVycm9yIiwiZXJyIiwiY29tcGxldGUiLCJkZWxldGUiLCJzaXplIiwiZW5kIiwidW5zdWJzY3JpYmUiLCJwdWxsQ2hhbmdlcyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBRUE7O0FBRWUsU0FBU0EsS0FBVCxDQUFrQkMsUUFBbEIsRUFBMkQ7QUFDeEUsU0FBTyxJQUFJQyxTQUFKLENBQVk7QUFDakJDLElBQUFBLFNBQVMsRUFBRUYsUUFBUSxDQUFDLENBQUQsQ0FBUixHQUFjQSxRQUFRLENBQUMsQ0FBRCxDQUFSLENBQVlHLFlBQVosRUFBZCxHQUEyQ0MsU0FEckM7QUFFakJDLElBQUFBLElBRmlCLGtCQUVWO0FBQ0wsVUFBTUMsQ0FBQyxHQUFHLElBQUlDLEdBQUosRUFBVjtBQUNBUCxNQUFBQSxRQUFRLENBQUNRL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xuICAgICAgICAgIHN0YXJ0KF9zdWIpIHtcbiAgICAgICAgICAgIHN1YiA9IF9zdWI7XG4gICAgICAgICAgICBzdWJzLmFkZChzdWIpO1xuICAgICAgICAgICAgbGl2ZVNldC52YWx1ZXMoKS5mb3JFYWNoKHZhbHVlID0+IHtcbiAgICAgICAgICAgICAgaW5pdGlhbFZhbHVlcy5hZGQodmFsdWUpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSxcbiAgICAgICAgICBuZXh0KGNoYW5nZXMpIHtcbiAgICAgICAgICAgIGNoYW5nZXMuZm9yRWFjaChjaGFuZ2UgPT4ge1xuICAgICAgICAgICAgICBpZiAoY2hhbmdlLnR5cGUgPT09ICdhZGQnKSB7XG4gICAgICAgICAgICAgICAgY29udHJvbGxlci5hZGQoY2hhbmdlLnZhbHVlKTtcbiAgICAgICAgICAgICAgfSBlbHNlIGlmIChjaGFuZ2UudHlwZSA9PT0gJ3JlbW92ZScpIHtcbiAgICAgICAgICAgICAgICBjb250cm9sbGVyLnJlbW92ZShjaGFuZ2UudmFsdWUpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIGVycm9yKGVycikge1xuICAgICAgICAgICAgY29udHJvbGxlci5lcnJvcihlcnIpO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgY29tcGxldGUoKSB7XG4gICAgICAgICAgICBzdWJzLmRlbGV0ZShzdWIpO1xuICAgICAgICAgICAgaWYgKGRvbmVTdWJzY3JpYmluZyAmJiBzdWJzLnNpemUgPT09IDApIHtcbiAgICAgICAgICAgICAgY29udHJvbGxlci5lbmQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgfSk7XG5cbiAgICAgIHNldFZhbHVlcyhpbml0aWFsVmFsdWVzKTtcblxuICAgICAgZG9uZVN1YnNjcmliaW5nID0gdHJ1ZTtcbiAgICAgIGlmIChzdWJzLnNpemUgPT09IDApIHtcbiAgICAgICAgY29udHJvbGxlci5lbmQoKTtcbiAgICAgIH1cbiAgICAgIHJldHVybiB7XG4gICAgICAgIHVuc3Vic2NyaWJlKCkge1xuICAgICAgICAgIHN1YnMuZm9yRWFjaChzdWIgPT4ge1xuICAgICAgICAgICAgc3ViLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0sXG4gICAgICAgIHB1bGxDaGFuZ2VzKCkge1xuICAgICAgICAgIHN1YnMuZm9yRWFjaChzdWIgPT4ge1xuICAgICAgICAgICAgc3ViLnB1bGxDaGFuZ2VzKCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgIH07XG4gICAgfVxuICB9KTtcbn1cbiJdfQ== |
{ | ||
"name": "live-set", | ||
"version": "0.4.4", | ||
"version": "1.0.0", | ||
"description": "Class representing a changing and transformable collection of items.", | ||
"main": "index.js", | ||
"sideEffects": false, | ||
"scripts": { | ||
"prepare": "rm -f *.js *.flow && babel -s inline -d ./ src/ --ignore '*.test.*' && flow-copy-source -v src . --ignore '*.test.*'", | ||
"test": "yarn run lint && yarn run flow_check && jest", | ||
"flow_check": "flow check", | ||
"prepare": "rm -f *.js *.flow && babel -s inline -d ./ src/ --ignore '**/*.test.js' && flow-copy-source -v src . --ignore '*.test.*'", | ||
"test": "yarn run lint && flow check && jest && tsc", | ||
"lint": "eslint .", | ||
@@ -35,26 +35,30 @@ "lint-fix": "eslint . --fix" | ||
"dependencies": { | ||
"@babel/runtime": "^7.0.0", | ||
"@types/transducers.js": "^0.3.0", | ||
"@types/zen-observable": "^0.8.0", | ||
"asap": "^2.0.5", | ||
"babel-runtime": "^6.22.0", | ||
"envify": "^4.0.0", | ||
"symbol-observable": "^1.0.4", | ||
"zen-observable": "^0.6.0" | ||
"zen-observable": "^0.8.9" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.22.2", | ||
"babel-core": "^6.26.0", | ||
"babel-eslint": "^8.0.2", | ||
"babel-jest": "^23.4.2", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-plugin-transform-flow-strip-types": "^6.22.0", | ||
"babel-plugin-transform-runtime": "^6.22.0", | ||
"babel-preset-es2015": "^6.22.0", | ||
"babel-preset-stage-2": "^6.22.0", | ||
"eslint": "^4.1.1", | ||
"eslint-plugin-flowtype": "^2.30.0", | ||
"flow-bin": "^0.80.0", | ||
"@babel/cli": "^7.0.0", | ||
"@babel/core": "^7.0.0", | ||
"@babel/plugin-proposal-class-properties": "^7.0.0", | ||
"@babel/plugin-transform-runtime": "^7.0.0", | ||
"@babel/preset-env": "^7.0.0", | ||
"@babel/preset-flow": "^7.0.0", | ||
"babel-core": "^7.0.0-bridge.0", | ||
"babel-eslint": "^10.0.1", | ||
"babel-jest": "^23.6.0", | ||
"babel-plugin-add-module-exports": "^1.0.0", | ||
"eslint": "^5.6.1", | ||
"eslint-plugin-flowtype": "^2.50.0", | ||
"flow-bin": "^0.82.0", | ||
"flow-copy-source": "^2.0.2", | ||
"jest": "^23.5.0", | ||
"pdelay": "^1.0.0", | ||
"transducers.js": "^0.3.2" | ||
"pdelay": "^2.0.0", | ||
"transducers.js": "^0.3.2", | ||
"typescript": "^3.1.1" | ||
} | ||
} |
# live-set | ||
[![Circle CI](https://circleci.com/gh/StreakYC/live-set.svg?style=shield)](https://circleci.com/gh/StreakYC/live-set) | ||
[![npm version](https://badge.fury.io/js/live-set.svg)](https://badge.fury.io/js/live-set) | ||
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/StreakYC/live-set/blob/master/LICENSE.txt) [![Circle CI](https://circleci.com/gh/StreakYC/live-set.svg?style=shield)](https://circleci.com/gh/StreakYC/live-set) [![npm version](https://badge.fury.io/js/live-set.svg)](https://badge.fury.io/js/live-set) | ||
@@ -543,5 +542,10 @@ This class is basically a Set with a subscribe() method that calls your | ||
Browser support for `Map`, `Set`, and `Promise` is required. Load a polyfill | ||
for these (such as [@babel/polyfill](https://babeljs.io/docs/en/babel-polyfill)) | ||
if you need to support browsers that don't natively support these. | ||
## Types | ||
[Flow](https://flowtype.org/) type declarations for this module are included! | ||
If you are using Flow, they won't require any configuration to use. | ||
Both [TypeScript](https://www.typescriptlang.org/) and | ||
[Flow](https://flowtype.org/) type definitions for this module are included! | ||
The type definitions won't require any configuration to use. |
@@ -1,33 +0,32 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _createClass2 = require('babel-runtime/helpers/createClass'); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
var _createClass3 = _interopRequireDefault(_createClass2); | ||
var _asap = _interopRequireDefault(require("asap")); | ||
var _asap = require('asap'); | ||
var _asap2 = _interopRequireDefault(_asap); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var CAPACITY = 1024; | ||
var Scheduler = function () { | ||
var Scheduler = | ||
/*#__PURE__*/ | ||
function () { | ||
function Scheduler() { | ||
(0, _classCallCheck3.default)(this, Scheduler); | ||
this._queue = []; | ||
this._isFlushing = false; | ||
this._index = 0; | ||
(0, _classCallCheck2.default)(this, Scheduler); | ||
(0, _defineProperty2.default)(this, "_queue", []); | ||
(0, _defineProperty2.default)(this, "_isFlushing", false); | ||
(0, _defineProperty2.default)(this, "_index", 0); | ||
} | ||
(0, _createClass3.default)(Scheduler, [{ | ||
key: 'schedule', | ||
(0, _createClass2.default)(Scheduler, [{ | ||
key: "schedule", | ||
value: function schedule(cb) { | ||
@@ -45,4 +44,5 @@ var _this = this; | ||
}); | ||
if (this._queue.length === 1) { | ||
(0, _asap2.default)(function () { | ||
(0, _asap.default)(function () { | ||
_this.flush(); | ||
@@ -53,3 +53,3 @@ }); | ||
}, { | ||
key: 'flush', | ||
key: "flush", | ||
value: function flush() { | ||
@@ -60,2 +60,3 @@ // based on https://github.com/kriskowal/asap/blob/master/raw.js | ||
var queue = this._queue; | ||
while (this._index < queue.length) { | ||
@@ -65,2 +66,3 @@ var currentIndex = this._index; | ||
queue[currentIndex].call(); | ||
if (this._index > CAPACITY) { | ||
@@ -70,2 +72,3 @@ for (var scan = 0, newLength = queue.length - this._index; scan < newLength; scan++) { | ||
} | ||
queue.length -= this._index; | ||
@@ -75,2 +78,3 @@ this._index = 0; | ||
} | ||
queue.length = 0; | ||
@@ -85,3 +89,4 @@ this._index = 0; | ||
exports.default = Scheduler; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9TY2hlZHVsZXIuanMiXSwibmFtZXMiOlsiQ0FQQUNJVFkiLCJTY2hlZHVsZXIiLCJfcXVldWUiLCJfaXNGbHVzaGluZyIsIl9pbmRleCIsImNiIiwicHVzaCIsImUiLCJzZXRUaW1lb3V0IiwibGVuZ3RoIiwiZmx1c2giLCJxdWV1ZSIsImN1cnJlbnRJbmRleCIsImNhbGwiLCJzY2FuIiwibmV3TGVuZ3RoIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztBQUVBOzs7Ozs7QUFFQSxJQUFNQSxXQUFXLElBQWpCOztJQUVxQkMsUzs7O1NBQ25CQyxNLEdBQTBCLEU7U0FDMUJDLFcsR0FBdUIsSztTQUN2QkMsTSxHQUFpQixDOzs7Ozs2QkFFUkMsRSxFQUFjO0FBQUE7O0FBQ3JCLFdBQUtILE1BQUwsQ0FBWUksSUFBWixDQUFpQixZQUFNO0FBQ3JCLFlBQUk7QUFDRkQ7QUFDRCx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AgdGhpcy5faW5kZXggKz0gMTtcbiAgICAgIHF1ZXVlW2N1cnJlbnRJbmRleF0uY2FsbCgpO1xuICAgICAgaWYgKHRoaXMuX2luZGV4ID4gQ0FQQUNJVFkpIHtcbiAgICAgICAgZm9yIChsZXQgc2NhbiA9IDAsIG5ld0xlbmd0aCA9IHF1ZXVlLmxlbmd0aCAtIHRoaXMuX2luZGV4OyBzY2FuIDwgbmV3TGVuZ3RoOyBzY2FuKyspIHtcbiAgICAgICAgICBxdWV1ZVtzY2FuXSA9IHF1ZXVlW3NjYW4gKyB0aGlzLl9pbmRleF07XG4gICAgICAgIH1cbiAgICAgICAgcXVldWUubGVuZ3RoIC09IHRoaXMuX2luZGV4O1xuICAgICAgICB0aGlzLl9pbmRleCA9IDA7XG4gICAgICB9XG4gICAgfVxuICAgIHF1ZXVlLmxlbmd0aCA9IDA7XG4gICAgdGhpcy5faW5kZXggPSAwO1xuICAgIHRoaXMuX2lzRmx1c2hpbmcgPSBmYWxzZTtcbiAgfVxufVxuIl19 | ||
module.exports = exports.default; | ||
module.exports.default = exports.default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9TY2hlZHVsZXIuanMiXSwibmFtZXMiOlsiQ0FQQUNJVFkiLCJTY2hlZHVsZXIiLCJjYiIsIl9xdWV1ZSIsInB1c2giLCJlIiwic2V0VGltZW91dCIsImxlbmd0aCIsImZsdXNoIiwiX2lzRmx1c2hpbmciLCJxdWV1ZSIsIl9pbmRleCIsImN1cnJlbnRJbmRleCIsImNhbGwiLCJzY2FuIiwibmV3TGVuZ3RoIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7QUFFQTs7QUFFQSxJQUFNQSxRQUFRLEdBQUcsSUFBakI7O0lBRXFCQyxTOzs7OztrREFDTyxFO3VEQUNILEs7a0RBQ04sQzs7Ozs7NkJBRVJDLEUsRUFBYztBQUFBOztBQUNyQixXQUF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hpcy5faXNGbHVzaGluZykgcmV0dXJuO1xuICAgIHRoaXMuX2lzRmx1c2hpbmcgPSB0cnVlO1xuICAgIGNvbnN0IHF1ZXVlID0gdGhpcy5fcXVldWU7XG4gICAgd2hpbGUgKHRoaXMuX2luZGV4IDwgcXVldWUubGVuZ3RoKSB7XG4gICAgICBjb25zdCBjdXJyZW50SW5kZXggPSB0aGlzLl9pbmRleDtcbiAgICAgIHRoaXMuX2luZGV4ICs9IDE7XG4gICAgICBxdWV1ZVtjdXJyZW50SW5kZXhdLmNhbGwoKTtcbiAgICAgIGlmICh0aGlzLl9pbmRleCA+IENBUEFDSVRZKSB7XG4gICAgICAgIGZvciAobGV0IHNjYW4gPSAwLCBuZXdMZW5ndGggPSBxdWV1ZS5sZW5ndGggLSB0aGlzLl9pbmRleDsgc2NhbiA8IG5ld0xlbmd0aDsgc2NhbisrKSB7XG4gICAgICAgICAgcXVldWVbc2Nhbl0gPSBxdWV1ZVtzY2FuICsgdGhpcy5faW5kZXhdO1xuICAgICAgICB9XG4gICAgICAgIHF1ZXVlLmxlbmd0aCAtPSB0aGlzLl9pbmRleDtcbiAgICAgICAgdGhpcy5faW5kZXggPSAwO1xuICAgICAgfVxuICAgIH1cbiAgICBxdWV1ZS5sZW5ndGggPSAwO1xuICAgIHRoaXMuX2luZGV4ID0gMDtcbiAgICB0aGlzLl9pc0ZsdXNoaW5nID0gZmFsc2U7XG4gIH1cbn1cbiJdfQ== |
@@ -1,42 +0,28 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _getIterator2 = require('babel-runtime/core-js/get-iterator'); | ||
var _getIterator3 = _interopRequireDefault(_getIterator2); | ||
var _promise = require('babel-runtime/core-js/promise'); | ||
var _promise2 = _interopRequireDefault(_promise); | ||
var _map = require('babel-runtime/core-js/map'); | ||
var _map2 = _interopRequireDefault(_map); | ||
exports.default = toValueObservable; | ||
var _ = require('.'); | ||
var _ = _interopRequireDefault(require(".")); | ||
var _2 = _interopRequireDefault(_); | ||
var _zenObservable = _interopRequireDefault(require("zen-observable")); | ||
var _zenObservable = require('zen-observable'); | ||
var _zenObservable2 = _interopRequireDefault(_zenObservable); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function toValueObservable(liveSet) { | ||
return new _zenObservable2.default(function (observer) { | ||
var resolvers = new _map2.default(); | ||
return new _zenObservable.default(function (observer) { | ||
var resolvers = new Map(); | ||
function addedItem(value) { | ||
var resolve = void 0; | ||
var removal = new _promise2.default(function (_resolve) { | ||
var resolve; | ||
var removal = new Promise(function (_resolve) { | ||
resolve = _resolve; | ||
}); | ||
resolvers.set(value, resolve); | ||
var valueWithRemoval = { value: value, removal: removal }; | ||
var valueWithRemoval = { | ||
value: value, | ||
removal: removal | ||
}; | ||
observer.next(valueWithRemoval); | ||
@@ -59,7 +45,6 @@ } | ||
try { | ||
for (var _iterator = (0, _getIterator3.default)(liveSet.values()), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var _value = _step.value; | ||
for (var _iterator = liveSet.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var value = _step.value; | ||
if (sub.closed) break; | ||
addedItem(_value); | ||
addedItem(value); | ||
} | ||
@@ -71,3 +56,3 @@ } catch (err) { | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator.return) { | ||
if (!_iteratorNormalCompletion && _iterator.return != null) { | ||
_iterator.return(); | ||
@@ -98,3 +83,2 @@ } | ||
}); | ||
return function () { | ||
@@ -108,3 +92,5 @@ sub.unsubscribe(); | ||
} | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy90b1ZhbHVlT2JzZXJ2YWJsZS5q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AgICB9KTtcblxuICAgIHJldHVybiAoKSA9PiB7XG4gICAgICBzdWIudW5zdWJzY3JpYmUoKTtcbiAgICAgIHJlc29sdmVycy5mb3JFYWNoKHJlc29sdmVyID0+IHtcbiAgICAgICAgcmVzb2x2ZXIoKTtcbiAgICAgIH0pO1xuICAgIH07XG4gIH0pO1xufVxuIl19 | ||
module.exports = exports.default; | ||
module.exports.default = exports.default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy90b1ZhbHVlT2JzZXJ2YWJsZS5qcyJdLCJuYW1lcyI6WyJ0b1ZhbHVlT2JzZXJ2YWJsZSIsImxpdmVTZXQiLCJPYnNlcnZhYmxlIiwib2JzZXJ2ZXIiLCJyZXNvbHZlcnMiLCJNYXAiLCJhZGRlZEl0ZW0iLCJ2YWx1ZSIsInJlc29sdmUiLCJyZW1vdmFsIiwiUHJvbWlzZSIsIl9yZXNvbHZlIiwic2V0IiwidmFsdWVXaXRoUmVtb3ZhbCIsIm5leHQiLCJyZW1vdmVkSXRlbSIsInJlc29sdmVyIiwiZ2V0IiwiRXJyb3IiLCJkZWxldGUiLCJzdWIiLCJzdWJzY3JpYmUiLCJzdGFydCIsInZhbHVlcyIsImNsb3NlZCIsImNoYW5nZXMiLCJmb3JFYWNoIiwiY2hhbmdlIiwidHlwZSIsImVycm9yIiwiZXJyIiwiY29tcGxldGUiLCJ1bnN1YnNjcmliZSJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBRUE7O0FBQ0E7O0FBT2UsU0FBU0EsaUJBQVQsQ0FBOEJDLE9BQTlCLEVBQW1EO0FBQ2hFLFNBQU8sSUFBSUMsc0JBQUosQ0FBZSxVQUFBQyxRQUFRLEVBQUk7QUFDaEMsUUFBTUMsU0FBMkIsR0FBRyxJQUFJQyxHQUFKLEVBQXBDOztBQUVBLGFBQVNDLFNBQVQsQ0FBbUJDLEtBQW5CLEVBQTZCO0FBQzNC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O1xuICAgIH1cblxuICAgIGNvbnN0IHN1YiA9IGxpdmVTZXQuc3Vic2NyaWJlKHtcbiAgICAgIHN0YXJ0KHN1Yikge1xuICAgICAgICBmb3IgKGxldCB2YWx1ZSBvZiBsaXZlU2V0LnZhbHVlcygpKSB7XG4gICAgICAgICAgaWYgKHN1Yi5jbG9zZWQpIGJyZWFrO1xuICAgICAgICAgIGFkZGVkSXRlbSh2YWx1ZSk7XG4gICAgICAgIH1cbiAgICAgIH0sXG4gICAgICBuZXh0KGNoYW5nZXMpIHtcbiAgICAgICAgY2hhbmdlcy5mb3JFYWNoKGNoYW5nZSA9PiB7XG4gICAgICAgICAgaWYgKGNoYW5nZS50eXBlID09PSAnYWRkJykge1xuICAgICAgICAgICAgYWRkZWRJdGVtKGNoYW5nZS52YWx1ZSk7XG4gICAgICAgICAgfSBlbHNlIGlmIChjaGFuZ2UudHlwZSA9PT0gJ3JlbW92ZScpIHtcbiAgICAgICAgICAgIHJlbW92ZWRJdGVtKGNoYW5nZS52YWx1ZSk7XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgIH0sXG4gICAgICBlcnJvcihlcnIpIHtcbiAgICAgICAgb2JzZXJ2ZXIuZXJyb3IoZXJyKTtcbiAgICAgIH0sXG4gICAgICBjb21wbGV0ZSgpIHtcbiAgICAgICAgb2JzZXJ2ZXIuY29tcGxldGUoKTtcbiAgICAgIH1cbiAgICB9KTtcblxuICAgIHJldHVybiAoKSA9PiB7XG4gICAgICBzdWIudW5zdWJzY3JpYmUoKTtcbiAgICAgIHJlc29sdmVycy5mb3JFYWNoKHJlc29sdmVyID0+IHtcbiAgICAgICAgcmVzb2x2ZXIoKTtcbiAgICAgIH0pO1xuICAgIH07XG4gIH0pO1xufVxuIl19 |
@@ -1,27 +0,12 @@ | ||
'use strict'; | ||
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _getIterator2 = require('babel-runtime/core-js/get-iterator'); | ||
var _getIterator3 = _interopRequireDefault(_getIterator2); | ||
var _set = require('babel-runtime/core-js/set'); | ||
var _set2 = _interopRequireDefault(_set); | ||
var _map = require('babel-runtime/core-js/map'); | ||
var _map2 = _interopRequireDefault(_map); | ||
exports.default = transduce; | ||
var _ = require('.'); | ||
var _ = _interopRequireDefault(require(".")); | ||
var _2 = _interopRequireDefault(_); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var arrayXf = { | ||
@@ -43,4 +28,5 @@ '@@transducer/init': function transducerInit() { | ||
var addsComplete = false; | ||
var outputValues = void 0; | ||
var outputValues; | ||
var ret = xform['@@transducer/step']([], inputValue); | ||
if (ret && ret['@@transducer/reduced']) { | ||
@@ -52,2 +38,3 @@ outputValues = ret['@@transducer/value']; | ||
} | ||
return { | ||
@@ -60,6 +47,6 @@ outputValues: outputValues, | ||
function valuesAndContext() { | ||
var inputToOutputValues = new _map2.default(); | ||
var inputToOutputValues = new Map(); | ||
var xform = transducer(arrayXf); | ||
var addsComplete = false; | ||
var values = new _set2.default(xform['@@transducer/init']()); | ||
var values = new Set(xform['@@transducer/init']()); | ||
var _iteratorNormalCompletion = true; | ||
@@ -70,3 +57,3 @@ var _didIteratorError = false; | ||
try { | ||
for (var _iterator = (0, _getIterator3.default)(liveSet.values()), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
for (var _iterator = liveSet.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var value = _step.value; | ||
@@ -79,5 +66,7 @@ | ||
inputToOutputValues.set(value, outputValues); | ||
for (var i = 0, len = outputValues.length; i < len; i++) { | ||
values.add(outputValues[i]); | ||
} | ||
if (_addsComplete) { | ||
@@ -96,3 +85,3 @@ addsComplete = true; | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator.return) { | ||
if (!_iteratorNormalCompletion && _iterator.return != null) { | ||
_iterator.return(); | ||
@@ -115,3 +104,3 @@ } | ||
return new _2.default({ | ||
return new _.default({ | ||
scheduler: liveSet.getScheduler(), | ||
@@ -122,5 +111,3 @@ read: function read() { | ||
listen: function listen(setValues, controller) { | ||
var inputToOutputValues = void 0, | ||
xform = void 0, | ||
addsComplete = void 0; | ||
var inputToOutputValues, xform, addsComplete; | ||
var sub = liveSet.subscribe({ | ||
@@ -137,2 +124,3 @@ start: function start() { | ||
var change = changes[i]; | ||
if (change.type === 'add') { | ||
@@ -147,5 +135,7 @@ if (!addsComplete) { | ||
inputToOutputValues.set(value, outputValues); | ||
for (var _i = 0, _len = outputValues.length; _i < _len; _i++) { | ||
controller.add(outputValues[_i]); | ||
} | ||
if (_addsComplete) { | ||
@@ -160,3 +150,2 @@ addsComplete = true; | ||
var _value = change.value; | ||
var list = inputToOutputValues.get(_value); | ||
@@ -178,3 +167,2 @@ if (!list) throw new Error('value had not been added'); | ||
}); | ||
return sub; | ||
@@ -184,3 +172,5 @@ } | ||
} | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy90cmFuc2R1Y2UuanMiXSwibmFtZXMiOlsidHJhbnNkdWNlIiwiYXJyYXlYZiIsInJlcyIsImlucHV0IiwicHVzaCIsImxpdmVTZXQiLCJ0cmFuc2R1Y2VyIiwic3RlcCIsInhmb3JtIiwiaW5wdXRWYWx1ZSIsImFkZHNDb21wbGV0ZSIsIm91dHB1dFZhbHVlcyIsInJldCIsInZhbHVlc0FuZENvbnRleHQiLCJpbnB1dFRvT3V0cHV0VmFsdWVzIiwidmFsdWVzIiwidmFsdWUiLCJfYWRkc0NvbXBsZXRlIiwic2V0IiwiaSIsImxlbiIsImxlbmd0aCIsImFkZCIsImZvckVhY2giLCJMaXZlU2V0Iiwic2NoZWR1bGVyIiwiZ2V0U2NoZWR1bGVyIiwicmVhZCIsImxpc3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bmdlcykge1xuICAgICAgICAgIGZvciAobGV0IGk9MCxsZW49Y2hhbmdlcy5sZW5ndGg7IGk8bGVuOyBpKyspIHtcbiAgICAgICAgICAgIGNvbnN0IGNoYW5nZSA9IGNoYW5nZXNbaV07XG4gICAgICAgICAgICBpZiAoY2hhbmdlLnR5cGUgPT09ICdhZGQnKSB7XG4gICAgICAgICAgICAgIGlmICghYWRkc0NvbXBsZXRlKSB7XG4gICAgICAgICAgICAgICAgY29uc3Qge3ZhbHVlfSA9IGNoYW5nZTtcbiAgICAgICAgICAgICAgICBjb25zdCB7b3V0cHV0VmFsdWVzLCBhZGRzQ29tcGxldGU6IF9hZGRzQ29tcGxldGV9ID0gc3RlcCh4Zm9ybSwgdmFsdWUpO1xuICAgICAgICAgICAgICAgIGlucHV0VG9PdXRwdXRWYWx1ZXMuc2V0KHZhbHVlLCBvdXRwdXRWYWx1ZXMpO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGk9MCxsZW49b3V0cHV0VmFsdWVzLmxlbmd0aDsgaTxsZW47IGkrKykge1xuICAgICAgICAgICAgICAgICAgY29udHJvbGxlci5hZGQob3V0cHV0VmFsdWVzW2ldKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKF9hZGRzQ29tcGxldGUpIHtcbiAgICAgICAgICAgICAgICAgIGFkZHNDb21wbGV0ZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICB4Zm9ybVsnQEB0cmFuc2R1Y2VyL3Jlc3VsdCddKFtdKS5mb3JFYWNoKGVuZFZhbHVlID0+IHtcbiAgICAgICAgICAgICAgICAgICAgY29udHJvbGxlci5hZGQoZW5kVmFsdWUpO1xuICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNoYW5nZS50eXBlID09PSAncmVtb3ZlJykge1xuICAgICAgICAgICAgICBjb25zdCB7dmFsdWV9ID0gY2hhbmdlO1xuICAgICAgICAgICAgICBjb25zdCBsaXN0ID0gaW5wdXRUb091dHB1dFZhbHVlcy5nZXQodmFsdWUpO1xuICAgICAgICAgICAgICBpZiAoIWxpc3QpIHRocm93IG5ldyBFcnJvcigndmFsdWUgaGFkIG5vdCBiZWVuIGFkZGVkJyk7XG4gICAgICAgICAgICAgIGxpc3QuZm9yRWFjaCh0cmFuc2Zvcm1lZFZhbHVlID0+IHtcbiAgICAgICAgICAgICAgICBjb250cm9sbGVyLnJlbW92ZSh0cmFuc2Zvcm1lZFZhbHVlKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIGlucHV0VG9PdXRwdXRWYWx1ZXMuZGVsZXRlKHZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGVycm9yKGVycikge1xuICAgICAgICAgIGNvbnRyb2xsZXIuZXJyb3IoZXJyKTtcbiAgICAgICAgfSxcbiAgICAgICAgY29tcGxldGUoKSB7XG4gICAgICAgICAgY29udHJvbGxlci5lbmQoKTtcbiAgICAgICAgfVxuICAgICAgfSk7XG5cbiAgICAgIHJldHVybiBzdWI7XG4gICAgfVxuICB9KTtcbn1cbiJdfQ== | ||
module.exports = exports.default; | ||
module.exports.default = exports.default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy90cmFuc2R1Y2UuanMiXSwibmFtZXMiOlsiYXJyYXlYZiIsInJlcyIsImlucHV0IiwicHVzaCIsInRyYW5zZHVjZSIsImxpdmVTZXQiLCJ0cmFuc2R1Y2VyIiwic3RlcCIsInhmb3JtIiwiaW5wdXRWYWx1ZSIsImFkZHNDb21wbGV0ZSIsIm91dHB1dFZhbHVlcyIsInJldCIsInZhbHVlc0FuZENvbnRleHQiLCJpbnB1dFRvT3V0cHV0VmFsdWVzIiwiTWFwIiwidmFsdWVzIiwiU2V0IiwidmFsdWUiLC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HQoY2hhbmdlcykge1xuICAgICAgICAgIGZvciAobGV0IGk9MCxsZW49Y2hhbmdlcy5sZW5ndGg7IGk8bGVuOyBpKyspIHtcbiAgICAgICAgICAgIGNvbnN0IGNoYW5nZSA9IGNoYW5nZXNbaV07XG4gICAgICAgICAgICBpZiAoY2hhbmdlLnR5cGUgPT09ICdhZGQnKSB7XG4gICAgICAgICAgICAgIGlmICghYWRkc0NvbXBsZXRlKSB7XG4gICAgICAgICAgICAgICAgY29uc3Qge3ZhbHVlfSA9IGNoYW5nZTtcbiAgICAgICAgICAgICAgICBjb25zdCB7b3V0cHV0VmFsdWVzLCBhZGRzQ29tcGxldGU6IF9hZGRzQ29tcGxldGV9ID0gc3RlcCh4Zm9ybSwgdmFsdWUpO1xuICAgICAgICAgICAgICAgIGlucHV0VG9PdXRwdXRWYWx1ZXMuc2V0KHZhbHVlLCBvdXRwdXRWYWx1ZXMpO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGk9MCxsZW49b3V0cHV0VmFsdWVzLmxlbmd0aDsgaTxsZW47IGkrKykge1xuICAgICAgICAgICAgICAgICAgY29udHJvbGxlci5hZGQob3V0cHV0VmFsdWVzW2ldKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKF9hZGRzQ29tcGxldGUpIHtcbiAgICAgICAgICAgICAgICAgIGFkZHNDb21wbGV0ZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICB4Zm9ybVsnQEB0cmFuc2R1Y2VyL3Jlc3VsdCddKFtdKS5mb3JFYWNoKGVuZFZhbHVlID0+IHtcbiAgICAgICAgICAgICAgICAgICAgY29udHJvbGxlci5hZGQoZW5kVmFsdWUpO1xuICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNoYW5nZS50eXBlID09PSAncmVtb3ZlJykge1xuICAgICAgICAgICAgICBjb25zdCB7dmFsdWV9ID0gY2hhbmdlO1xuICAgICAgICAgICAgICBjb25zdCBsaXN0ID0gaW5wdXRUb091dHB1dFZhbHVlcy5nZXQodmFsdWUpO1xuICAgICAgICAgICAgICBpZiAoIWxpc3QpIHRocm93IG5ldyBFcnJvcigndmFsdWUgaGFkIG5vdCBiZWVuIGFkZGVkJyk7XG4gICAgICAgICAgICAgIGxpc3QuZm9yRWFjaCh0cmFuc2Zvcm1lZFZhbHVlID0+IHtcbiAgICAgICAgICAgICAgICBjb250cm9sbGVyLnJlbW92ZSh0cmFuc2Zvcm1lZFZhbHVlKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIGlucHV0VG9PdXRwdXRWYWx1ZXMuZGVsZXRlKHZhbHVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIGVycm9yKGVycikge1xuICAgICAgICAgIGNvbnRyb2xsZXIuZXJyb3IoZXJyKTtcbiAgICAgICAgfSxcbiAgICAgICAgY29tcGxldGUoKSB7XG4gICAgICAgICAgY29udHJvbGxlci5lbmQoKTtcbiAgICAgICAgfVxuICAgICAgfSk7XG5cbiAgICAgIHJldHVybiBzdWI7XG4gICAgfVxuICB9KTtcbn1cbiJdfQ== |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
196863
38
1286
0
551
7
18
2
+ Added@babel/runtime@^7.0.0
+ Added@types/transducers.js@^0.3.0
+ Added@types/zen-observable@^0.8.0
+ Added@babel/runtime@7.26.0(transitive)
+ Added@types/transducers.js@0.3.4(transitive)
+ Added@types/zen-observable@0.8.7(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedzen-observable@0.8.15(transitive)
- Removedbabel-runtime@^6.22.0
- Removedbabel-runtime@6.26.0(transitive)
- Removedcore-js@2.6.12(transitive)
- Removedregenerator-runtime@0.11.1(transitive)
- Removedzen-observable@0.6.1(transitive)
Updatedzen-observable@^0.8.9