Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

async actions return undefined instead of Promise #548

Open
andpor opened this issue Jul 12, 2018 · 3 comments
Open

async actions return undefined instead of Promise #548

andpor opened this issue Jul 12, 2018 · 3 comments

Comments

@andpor
Copy link

andpor commented Jul 12, 2018

I have an action defined as

doSomething: { asyncResult: true}

in the code I have

doSomething("some params").then(..).catch(...)

This used to work in 0.2.x versions. After upgrade to 5.0.4 action invocation started to return undefined which naturally was throwing a JS exception.

Why is this no longer working? What is an alternative approach if this is not a bug?

@andpor
Copy link
Author

andpor commented Jul 12, 2018

I tried using reflux-promise@1.0.4 but npm warns about required peer of reflux-core^0.3.0 not installed. I am hesitant to install reflux-core^0.3.0 since reflux@5.0.4 wants reflux-core^0.4.3...

doSomething.triggerAsync("some params").then(..).catch(...)

does not work. undefined is returned by triggerAsync...

@andpor andpor closed this as completed Jul 12, 2018
@andpor andpor reopened this Jul 12, 2018
@andpor andpor changed the title async actions return undefined instead of Promise async actions return unidentified instead of Promise Jul 12, 2018
@andpor andpor changed the title async actions return unidentified instead of Promise async actions return undefined instead of Promise Jul 12, 2018
@javobal
Copy link

javobal commented Jul 27, 2018

Did you find a solution for this ?, i have a similar problem. i updated this library from 0.1.x and i originally used listenAndPromise but it seems is no longer an option.

@andpor
Copy link
Author

andpor commented Aug 3, 2018

I just could not get this to work which is a shame. I created a workaround by passing in a callback into action, execute a promise inside action handler which eventually invokes the callback...not exactly a clean solution but I had to make it work...

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants