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

Pass params in listenAndPromise #24

Open
vivekiyer114 opened this issue Oct 1, 2017 · 0 comments
Open

Pass params in listenAndPromise #24

vivekiyer114 opened this issue Oct 1, 2017 · 0 comments

Comments

@vivekiyer114
Copy link

support.jsx

.....
fetchData = () => {
        var params = {
            'internshipbuffer':this.state.buffer_id
        }
        supportAction.getMessage(params).then(this.updateData)
    }
.....

supportAction.jsx

import Reflux from 'reflux'
import supportResource from '../resources/supportResource'

var actions = Reflux.createActions({
    'getMessage': {
        children: ['completed', 'failed']
    }
});

actions.getMessage.listenAndPromise(supportResource.getMessage(params));

export default actions;

supportResource.jsx

import Api from '../util/api'

var supportResource = {
    getMessage(params) {
        return Api.get('/internshipbuffer/getChat', params);
    }
}

export default supportResource;

I am getting an error in supportAction.jsx :-

params is not defined

How to pass params to the resource ?
If i don't pass params i am getting undefined response

@vivekiyer114 vivekiyer114 changed the title Pass params in listen and promise Pass params in listenAndPromise Oct 1, 2017
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

No branches or pull requests

1 participant