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

Catching the finish event of a response? #144

Open
trusktr opened this issue Mar 27, 2014 · 2 comments
Open

Catching the finish event of a response? #144

trusktr opened this issue Mar 27, 2014 · 2 comments

Comments

@trusktr
Copy link

trusktr commented Mar 27, 2014

How would I execute something after Locomotive sends a response? In one of my controller#methods I've done

this.res.on("finish", function() {
    console.log(" -- Reponse sent! "); // Never happens.
});

but I never see the message logged to the console. Is there some way to do this in Locomotive?

I'm trying to keep track of some data across a few requests, then delete the data after a certain request is made, and the response to that request relies on the data, so I'm trying to clean up the data after the response to the final request is sent.

@drudge
Copy link
Contributor

drudge commented Jun 25, 2014

Use an after filter.

@trusktr
Copy link
Author

trusktr commented Nov 27, 2014

@drudge How does that guarantee the response is finished?

@jaredhanson ^

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