webpack-hot-middleware icon indicating copy to clipboard operation
webpack-hot-middleware copied to clipboard

feat: add disconnect on event source wrapper

Open clarkdo opened this issue 6 years ago • 2 comments

This PR contains a:

  • [ ] bugfix
  • [x] new feature
  • [ ] code refactor
  • [ ] test update
  • [ ] typo fix
  • [ ] metadata update

Motivation / Use-Case

Add disconect on EventSourceWrapper for making close eventSource manually possible.

Breaking Changes

Additional Info

clarkdo avatar Oct 06 '19 19:10 clarkdo

This code appears correct, but could you describe a use-case which would motivate doing this?

glenjamin avatar Oct 06 '19 20:10 glenjamin

My case is that I want to close connection if the browser tab is hidden or minimized and refresh page when tab gets activated again for preventing reaching connection limitations.

clarkdo avatar Oct 06 '19 20:10 clarkdo