When using FFI for Aff I need to use setTimeout before calling onSuccess or else the page hangs as if onSuccess was never called. Feels like there is some listener setup in the wrong order or onSuccess is defined after the return.
Failing example without timeout.
exports.failing = s => (onError, onSuccess) => {
onSuccess(s)
return (cancelError, cancelerError, cancelerSuccess) => {cancelerSuccess()}
}
Working example with timeout.
exports.working = s => (onError, onSuccess) => {
setTimeout(() => onSuccess(s), 100)
return (cancelError, cancelerError, cancelerSuccess) => {cancelerSuccess()}
}
When using FFI for Aff I need to use
setTimeoutbefore callingonSuccessor else the page hangs as ifonSuccesswas never called. Feels like there is some listener setup in the wrong order oronSuccessis defined after thereturn.Failing example without timeout.
exports.failing = s => (onError, onSuccess) => { onSuccess(s) return (cancelError, cancelerError, cancelerSuccess) => {cancelerSuccess()} }Working example with timeout.
exports.working = s => (onError, onSuccess) => { setTimeout(() => onSuccess(s), 100) return (cancelError, cancelerError, cancelerSuccess) => {cancelerSuccess()} }