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

Call async/await inside log and previouslyLogged #73

Open
paulinetheitgirl opened this issue Oct 17, 2018 · 1 comment
Open

Call async/await inside log and previouslyLogged #73

paulinetheitgirl opened this issue Oct 17, 2018 · 1 comment

Comments

@paulinetheitgirl
Copy link

If I call my own API inside the log() and previouslyLogged(), is it possible to use Promises or async/await to get the result of the API call? For example if I want to have an endpoint that writes the event to an external log inside log(), and then another endpoint that reads the log to determine if the event was previouslyLogged().

@thethomaseffect
Copy link

You probably long figured this out but yes and no. If you're manually calling log then there's nothing stopping you but if you use stuff like logExposure then your log function will be called without await and thus no way to handle errors. I'd take a look at the code in experiment.js and write your own logExposureAsync based on what's there for now.

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

2 participants