Skip to content
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

add asyncCall as an action parameter, #26

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

FredericHeem
Copy link

The idea behind this PR is to avoid calling directly listenAndPromise, instead, pass the function as a new action parameter asyncCall
Before:

let actions = Reflux.createActions({
    signupOrLoginThirdParty: { asyncResult: true },
    signupLocal: { asyncResult: true }
} );

actions.signupOrLoginThirdParty.listenAndPromise( auth.signupOrLoginThirdParty );
actions.signupLocal.listenAndPromise( auth.signupLocal );

After:

let actions = Reflux.createActions({
    signupOrLoginThirdParty: { asyncCall:  auth.signupOrLoginThirdParty },
    signupLocal: { asyncCall: auth.signupLocal }
} );

@@ -51,6 +51,13 @@ describe('Creating action', function() {
});
});

it.only("should create action with the parameter asyncCall",function(done){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minus the .only()

@devinivy
Copy link
Contributor

Given that promise support is broken out into the reflux-promise project, we'll have to figure out if this feature is suitable for reflux-core. I definitely do see why this feature may be desirable, but it needs to be balanced against keeping a fairly simple, not-too-too-magical core. In any case thanks for the contribution! We'll try to figure it out soon. CC @spoike @benglass.

@FredericHeem
Copy link
Author

Thanks for the catch, the .only has been removed.

@FredericHeem
Copy link
Author

Any news on that PR ?

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

Successfully merging this pull request may close these issues.

2 participants