light-observable
Advanced tools
Comparing version 2.0.0-beta.0 to 2.0.0-beta.1
@@ -8,3 +8,4 @@ export { createSubject } from './subject'; | ||
export { pipe } from './pipe'; | ||
export { skipRepeats } from './skipRepeats'; | ||
export { tap } from './tap'; | ||
export { throttle } from './throttle'; |
@@ -8,4 +8,5 @@ export { createSubject } from './subject'; | ||
export { pipe } from './pipe'; | ||
export { skipRepeats } from './skipRepeats'; | ||
export { tap } from './tap'; | ||
export { throttle } from './throttle'; | ||
//# sourceMappingURL=index.js.map |
@@ -348,2 +348,26 @@ 'use strict'; | ||
const defaultEquals = (a, b) => a === b; | ||
const skip = (equals) => { | ||
let init = true; | ||
let oldValue; | ||
return (observer, value) => { | ||
if (init) { | ||
init = false; | ||
oldValue = value; | ||
observer.next(value); | ||
return; | ||
} | ||
if (equals(oldValue, value)) { | ||
return; | ||
} | ||
oldValue = value; | ||
observer.next(value); | ||
}; | ||
}; | ||
const skipRepeats = (equals = defaultEquals) => { | ||
return (stream) => { | ||
return transform(stream, skip(equals)); | ||
}; | ||
}; | ||
const tap = (fn) => { | ||
@@ -391,3 +415,4 @@ return (stream) => { | ||
exports.pipe = pipe; | ||
exports.skipRepeats = skipRepeats; | ||
exports.tap = tap; | ||
exports.throttle = throttle$1; |
{ | ||
"name": "light-observable", | ||
"version": "2.0.0-beta.0", | ||
"version": "2.0.0-beta.1", | ||
"description": "Light observable ponyfill", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
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
63819
76
973