calling willMatchWith on a future() has uncaught error of missing 'listen' of undefined
See original GitHub issueHi there,
https://codesandbox.io/s/21o6kqn4zr
I made a simple sandbox here to show the problem, please look at the console, it’s the normale console in your browser.
In a nutshell, if we did
import { task } from "folktale/concurrency/task";
const delay = ms =>
task(res => {
setTimeout(() => res.resolve(ms), ms);
});
const taskA = delay(1000);
console.log('taskA')
taskA.run().future().willMatchWith({
Resolved: console.log,
Rejected: console.log,
Canceled: console.log
})
will throw
Uncaught TypeError: Cannot read property 'listen' of undefined
at Object.onResolved (VM3955 dll.js:19248)
at Object.Resolved (VM3955 dll.js:10379)
at InternalConstructor.matchWith (VM3955 dll.js:419)
at _loop (VM3955 dll.js:10376)
at moveToState (VM3955 dll.js:10392)
at Object.onResolved (VM3955 dll.js:10531)
at Object.Resolved (VM3955 dll.js:10379)
at InternalConstructor.matchWith (VM3955 dll.js:419)
at _loop (VM3955 dll.js:10376)
at moveToState (VM3955 dll.js:10392)
at Deferred.resolve (VM3955 dll.js:10432)
at Object.resolve (VM3955 dll.js:11016)
at eval
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Futures and error handling - Dart programming language
In the example above, if myFunc() 's Future completes with a value, then() 's callback fires. If no new error is produced within...
Read more >wait method - Future class - dart:async library
The cleanUp function is unused if there is no error. The call to cleanUp should not throw. If it does, the error will...
Read more >Z-Push Zimbra Backend - Browse /Release70 at SourceForge ...
This project provides a zimbra backend for the z-push open source ActiveSync implementation (http://z-push.sourceforge.net). It supports push email,…
Read more >Uncaught (in promise) Error: When called with an action of type
The request is okay and I can see the data when I console.log in the action creator but for some reason the reducer...
Read more >2 Entities - Oracle Help Center
If unspecified, the Coherence cluster multicast listen port will be used. ... getErrorCode() ), indicate that a fatal error has occurred and the...
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
Gotcha! Thanks again, really appreciate it!
Hey @robotlolita , nice of the authors to put automated check on even the docs, it seems like. – Oh believe me, even the time I spent on researching this will be minor compared with the time I’ll save with the safer code I’ll write with it 😉
That makes a lot of sense, because the way
listen
is describe elsewhere on the same doc. The way I understand it is thatlisten
is a straightforward unleashing the value to do some side-effect after a one off async action inside the task. Fair enough.And
willMatchWith
will be used for continuing chaining/mapping, like you already said, transforming the data.here’s that snippet on
listen