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

feat(sendEvent): return the value of the request function #200

Merged
merged 2 commits into from
Feb 14, 2020

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Feb 13, 2020

The existing request functions return undefined, so this isn't a breaking change, but this allows you to have a custom requester you can wait on (e.g. fetch).

fixes #199

The existing request functions return undefined, so this isn't a breaking change, but this allows you to have a custom requester you can wait on (e.g. fetch).

fixes #199
Copy link
Contributor

@tkrugg tkrugg left a comment

Choose a reason for hiding this comment

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

Hey @Haroenv, I understand the intention but this ineffective if you don't change the signature of requestFn and maybe even its implementations:
https://github.com/algolia/search-insights.js/blob/master/lib/utils/request.ts#L1
Also it would be worth adding a test checking we indeed return whatever requestFn returned, because if someone is relying on it, we'd like to detect when it's gone or stopped working

@Haroenv
Copy link
Contributor Author

Haroenv commented Feb 14, 2020

Don’t need to change the implementations, since that’s a breaking change, but this is for a custom requestFn to which you return something. Can add a test

@Haroenv Haroenv requested a review from tkrugg February 14, 2020 13:11
@Haroenv Haroenv merged commit 56b4ffd into master Feb 14, 2020
@Haroenv Haroenv deleted the Haroenv-patch-1 branch February 14, 2020 13:26
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.

Add wait on response
3 participants