marblejs / marble

Marble.js - functional reactive Node.js framework for building server-side applications, based on TypeScript and RxJS.
https://marblejs.com
MIT License
2.15k stars 69 forks source link

feat(core): `undefined` context dependency #321

Closed JozefFlakus closed 3 years ago

JozefFlakus commented 3 years ago

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the new behavior?

example usage:

export const createFooDependency = (config: Config): BoundDependency<Soo, any> =>
  Config.foo.enabled
    ? bindTo(FooToken)(FooDependency)
    : undefined;

Does this PR introduce a breaking change?

[ ] Yes
[x] No
codecov[bot] commented 3 years ago

Codecov Report

Merging #321 (7a29e6d) into master (cbdffda) will increase coverage by 0.31%. The diff coverage is 96.41%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #321      +/-   ##
==========================================
+ Coverage   95.41%   95.72%   +0.31%     
==========================================
  Files         157      163       +6     
  Lines        2769     3114     +345     
  Branches      366      429      +63     
==========================================
+ Hits         2642     2981     +339     
- Misses        123      128       +5     
- Partials        4        5       +1     
Impacted Files Coverage Δ
packages/core/src/context/context.hook.ts 100.00% <ø> (ø)
...ackages/core/src/effects/effectsContext.factory.ts 100.00% <ø> (ø)
packages/core/src/logger/logger.interface.ts 100.00% <ø> (ø)
packages/messaging/src/reply/reply.ts 100.00% <ø> (ø)
...rc/transport/strategies/amqp.strategy.interface.ts 81.81% <ø> (ø)
.../testing/src/testBed/http/http.testBed.response.ts 75.00% <40.00%> (-13.24%) :arrow_down:
packages/core/src/+internal/utils/string.util.ts 92.00% <66.66%> (-8.00%) :arrow_down:
packages/core/src/+internal/utils/any.util.ts 84.61% <71.42%> (+1.28%) :arrow_up:
...ore/src/http/response/http.responseBody.factory.ts 80.95% <73.33%> (-19.05%) :arrow_down:
...ssaging/src/transport/strategies/local.strategy.ts 92.15% <83.33%> (+4.92%) :arrow_up:
... and 72 more

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 fcbc7d1...7a29e6d. Read the comment docs.

JozefFlakus commented 3 years ago

@DawidYerginyan good question. I wondered the same and think it is not a problem to include it 🤔

DawidYerginyan commented 3 years ago

I agree 👍🏻