jinyus / lite_ref

A lightweight dependency injection library for Dart and Flutter.
11 stars 3 forks source link

Added ScopedFamilyRef #26

Closed yehorh closed 6 months ago

yehorh commented 6 months ago

Description

https://github.com/jinyus/lite_ref/issues/25#issue-2243685794

@jinyus

I suggest the following interface and implementation for the family feature. I am still in the process of writing tests and examples, but at the moment I am interested in opinions about the API and the fact that the watchCount will become unavailable for retrieval from ScopedRef since the state has been moved into a separate object.

Type of Change

jinyus commented 6 months ago

Thanks for the PR! This is basically what I had imagined.

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (623e433) to head (3f80332). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #26 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 8 10 +2 Lines 164 213 +49 ========================================= + Hits 164 213 +49 ``` | [Flag](https://app.codecov.io/gh/jinyus/lite_ref/pull/26/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jinyus) | Coverage Ξ” | | |---|---|---| | [unittests](https://app.codecov.io/gh/jinyus/lite_ref/pull/26/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jinyus) | `100.00% <100.00%> (ΓΈ)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jinyus#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jinyus commented 6 months ago

Looks good!

yehorh commented 6 months ago

Thanks! ☺️