fromPromise is not disposed correctly
See original GitHub issueSummary
Creating a stream with fromPromise
and then unsubscribing to it, most will execute the sequential steps even though the stream should be disposed
As example:
most
.fromPromise(new Promise(resolve => setTimeout(resolve, 2000)))
.tap(() => console.log('1'))
.merge(most.just().delay(1500)) // since 1500 < 2000, the fromPromise-stream should be unsubscribed at 1500 and any result after that should be ignored
.take(1)
.subscribe({
next: () => console.log('Finished'),
})
Expected result
console.log('Finished')
Actual Result
console.log('Finished')
console.log('1')
Versions
Seems to have been introduced when the following refactor was done: https://gist.github.com/briancavalier/a27ddc247dd118ae5508
- most.js: 1.7.2
Steps to reproduce
See above
Code to reproduce
most
.fromPromise(new Promise(resolve => setTimeout(resolve, 2000)))
.tap(() => console.log('1'))
.merge(most.just().delay(1500)) // since 1500 < 2000, the fromPromise-stream should be unsubscribed at 1500 and any result after that should be ignored
.take(1)
.subscribe({
next: () => console.log('Finished'),
})
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
fromPromise does not exist on type Observable - Stack Overflow
Property 'fromPromise' does not exist on type 'typeof Observable'. Observable was imported like: import { Observable } from "rxjs/Observable";.
Read more >Asynchronous unsubscribe method #4222 - ReactiveX/rxjs
The thing is that res.dispose() is async because it sends a request to a server, which is required to properly dispose of the...
Read more >Observable | RxJS API Document - ReactiveX
Creates an Observable that emits no items to the Observer and immediately ... this Observable keeps the subscription from being disposed automatically.
Read more >Observable - Babylon.js Documentation
Internal disposal method for observable-based coroutine scheduler instance. ... whether or not one observer registered with the given mask is handled ...
Read more >SMART TRASH: Study on RFID tags and ... - RAND Corporation
Waste that is not correctly disposed of can be automatically identified and separated based on RFID. Based on expert feedback, use cases 1...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@marcus13371337 We published 1.8.1 with the fix.
@briancavalier the changelog in the releases on github hasn’t been updated since 1.7.2 What changed in 1.8.0?