ryardley / ts-bus

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

RFC: Added new test on EventBus refactored subscription logic to be simpler(?) #41

Closed ryardley closed 4 years ago

ryardley commented 4 years ago

Hey @dmicic What do you think about this?

This is a pull request to your PR branch.

So it basically is more in line with the original code except I extracted a function that manages an individual subscription. This prevents us from having to keep track of multiple arrays etc.

Basically the trick is to convert the input to an array and map the simpler subscribe function over the array.

codecov[bot] commented 4 years ago

Codecov Report

Merging #41 into subscribe-event-array will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@                 Coverage Diff                  @@
##           subscribe-event-array    #41   +/-   ##
====================================================
  Coverage                    100%   100%           
====================================================
  Files                          6      6           
  Lines                         90     87    -3     
  Branches                      12     11    -1     
====================================================
- Hits                          90     87    -3
Impacted Files Coverage Δ
src/EventBus.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 687e9e3...3507660. Read the comment docs.

dmicic commented 4 years ago

@ryardley: I think you missed m comment from above. I should have commented in the other branch...

Just checking whether you read it. Cheers