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

[Feature Request] Show Ember Metrics allow promise from Adapters (or callback)? #170

Open
localpcguy opened this issue Jul 31, 2017 · 0 comments

Comments

@localpcguy
Copy link

In a situation where a website wants to perform an action once the metrics call is complete, it would be nice to be able to return a promise from the custom adapter (or pass in a callback to be called upon completion). Right now, the invoke method sends off the requests to the adapters, but there is no mechanism to allow something returned from the adapter to be returned back to the app. So even if the adapter is written to return a promise, it cannot.

It might be simpler to allow a callback to be passed along to the adapter, but I think a promise would be the preferable option.

As for a use case, I'm in a situation where we'd like to push an event when the user logs out, but would need to delay a page redirect to login until the call finishes, or the browser just aborts the request (if the request is ever even fired, depending on implementation in the adapter). But I imagine there are plenty of other use cases for knowing when the metrics call is complete.

If there is interest, I may be able to take a look at what it would take to implement.

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