-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FFI Requires setTimeout #176
Comments
I cannot reproduce this with a modified version of the EffectFn test that always resolves immediately. I suspect that you have some sort of race condition in your code. Could you post a self contained example? |
Created an example |
This is because you are typing it as purescript-aff/src/Effect/Aff/Compat.purs Lines 43 to 46 in 390857f
|
Sorry about that. Just fixed it and am still having the same problem |
When using FFI for Aff I need to use
setTimeout
before callingonSuccess
or else the page hangs as ifonSuccess
was never called. Feels like there is some listener setup in the wrong order oronSuccess
is defined after thereturn
.Failing example without timeout.
Working example with timeout.
exports.working = s => (onError, onSuccess) => { setTimeout(() => onSuccess(s), 100) return (cancelError, cancelerError, cancelerSuccess) => {cancelerSuccess()} }
The text was updated successfully, but these errors were encountered: