Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.catch(error =>
Observable.of({
type: 'error',
message: `An error occurred while attempting to delete document.
This usually means that you attempted to delete a document that other documents
refers to.`,
error
})
)
subscribe(value, type, fields) {
this.unsubscribe()
const viewOptions = this.props.ordering
? {ordering: this.props.ordering}
: {}
const visibilityOn$ = Observable.of(!document.hidden)
.merge(visibilityChange$.map(event => !event.target.hidden))
const inViewport$ = intersectionObservableFor(this._element)
.map(event => event.isIntersecting)
this.subscription = visibilityOn$
.distinctUntilChanged()
.switchMap(isVisible => (isVisible ? inViewport$ : Observable.of(false)))
.distinctUntilChanged()
.switchMap(isInViewport => {
return isInViewport
? observeForPreview(value, type, fields, viewOptions)
: Observable.of(null)
})
.subscribe(result => {
if (result) {
.switchMap(isVisible => (isVisible ? inViewport$ : Observable.of(false)))
.distinctUntilChanged()
.switchMap(isInViewport => {
return isInViewport
? observeForPreview(value, type, fields, viewOptions)
: Observable.of(null)
})
.subscribe(result => {