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) - promisified requests #405

Merged
merged 13 commits into from
Sep 6, 2019
Merged

Conversation

JoviDeCroock
Copy link
Collaborator

@JoviDeCroock JoviDeCroock commented Aug 23, 2019

Resolve #216

This is a POC with a minimal amount of added code to support this concept.

Wanted to give this a try, some concerns I'm having is what if we are polling? Multiple results will come in.
I would opt for no polling but yeah...

Been trying out some stuff but this does not seem to result in any responses during our tests

I've tried this in the examples and it works

src/client.ts Outdated Show resolved Hide resolved
src/client.ts Outdated Show resolved Hide resolved
@JoviDeCroock JoviDeCroock marked this pull request as ready for review September 6, 2019 13:02
src/client.ts Outdated Show resolved Hide resolved
src/client.ts Outdated Show resolved Hide resolved
src/client.ts Show resolved Hide resolved
take(1),
toPromise
);
return source$ as PromisifiedSource<T>;
Copy link
Member

Choose a reason for hiding this comment

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

This cast shouldn't be necessary and it may be better to remove the any fallback

@JoviDeCroock JoviDeCroock merged commit 9a3333a into master Sep 6, 2019
@JoviDeCroock JoviDeCroock deleted the feat/promisified-requests branch September 6, 2019 14:25
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 promisified request methods on the Client (especially for non-React API calls)
2 participants