You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
535 B
9 lines
535 B
4 months ago
|
export function iterateObserversSafely(observers, method, argument) {
|
||
|
// In case observers is modified during iteration, we need to commit to the
|
||
|
// original elements, which also provides an opportunity to filter them down
|
||
|
// to just the observers with the given method.
|
||
|
var observersWithMethod = [];
|
||
|
observers.forEach(function (obs) { return obs[method] && observersWithMethod.push(obs); });
|
||
|
observersWithMethod.forEach(function (obs) { return obs[method](argument); });
|
||
|
}
|
||
|
//# sourceMappingURL=iteration.js.map
|