ryardley / ts-bus

A lightweight JavaScript/TypeScript event bus to help manage your application architecture.
MIT License
135 stars 8 forks source link

Prevent memory leak in defaultSubscriber #26

Closed ryardley closed 5 years ago

ryardley commented 5 years ago

In the discussion around https://github.com/ryardley/ts-bus/issues/23#issuecomment-521470182 I discovered there is a subtle bug in the way we handle our default subscriber. Which probably would never have been triggered an inconsistent state but would have caused a memory leak as components were unmounted.

codecov[bot] commented 5 years ago

Codecov Report

Merging #26 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #26   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           5      5           
  Lines          56     57    +1     
  Branches       11     11           
=====================================
+ Hits           56     57    +1
Impacted Files Coverage Δ
src/useBusReducer.ts 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 23de6fb...d4b8729. Read the comment docs.

codecov[bot] commented 5 years ago

Codecov Report

Merging #26 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #26   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           5      5           
  Lines          56     72   +16     
  Branches       11     16    +5     
=====================================
+ Hits           56     72   +16
Impacted Files Coverage Δ
src/useBusReducer.ts 100% <100%> (ø) :arrow_up:
src/EventBus.ts 100% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 23de6fb...8b34e86. Read the comment docs.