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 onError and onSuccess callbacks #29

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

Conversation

jgladch
Copy link

@jgladch jgladch commented Mar 10, 2019

No description provided.

@maclauss
Copy link

maclauss commented Jun 12, 2022

@revolunet Hi Julien, could we merge this? Alternatively the subscribe function could return a promise.

Comment on lines +64 to +65
onSuccess: PropTypes.func,
onError: PropTypes.func,

Choose a reason for hiding this comment

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

Those are missing defaultProps below. For functions, it's a good practice to give a default value of a noop () => {} function.

Then, you won't need the if(this.props.onSuccess!==undefined) checks anymore.

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.

None yet

3 participants