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

Support for removing exit hooks #9

Closed
mfulton26 opened this issue Feb 22, 2018 · 4 comments · Fixed by #11
Closed

Support for removing exit hooks #9

mfulton26 opened this issue Feb 22, 2018 · 4 comments · Fixed by #11
Labels
enhancement 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted

Comments

@mfulton26
Copy link

mfulton26 commented Feb 22, 2018

Issuehunt badges

Sometimes I want to register an exit-hook to if my program gets interrupted, etc. but in normal execution of the program resources are cleaned once they are no longer needed. It would be great to have support for removing an exit-hook if it is no longer needed. Thanks.


IssueHunt Summary

dflupu dflupu has been rewarded.

Backers (Total: $30.00)

Submitted pull Requests


Tips


IssueHunt has been backed by the following sponsors. Become a sponsor

@sindresorhus
Copy link
Owner

The handler could return an unsubscribe function.

const unsubscribe = exitHook(() => {
	console.log('Exiting');
});

@corybill
Copy link

I have a nested node module that is using exit-hook in an AWS Lambda. The aws lambda is unable to exit because of the event listeners in exit-hook. This is turning into more of a necessity than a feature.

@IssueHuntBot
Copy link

@IssueHunt has funded $30.00 to this issue.


sindresorhus added a commit that referenced this issue Apr 9, 2019
Fixes #9 

Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
@issuehunt-oss issuehunt-oss bot added the 💵 Funded on Issuehunt This issue has been funded on Issuehunt label May 10, 2019
@issuehunt-oss
Copy link

issuehunt-oss bot commented Jan 23, 2020

@sindresorhus has rewarded $27.00 to @dflupu. See it on IssueHunt

  • 💰 Total deposit: $30.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $3.00

@issuehunt-oss issuehunt-oss bot added 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt and removed 💵 Funded on Issuehunt This issue has been funded on Issuehunt labels Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt help wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants