mobxjs / mobx.dart

MobX for the Dart language. Hassle-free, reactive state-management for your Dart and Flutter apps.
https://mobx.netlify.app
MIT License
2.4k stars 310 forks source link

Rename asObservable() to obs() (primitive types only) #831

Closed subzero911 closed 2 years ago

subzero911 commented 2 years ago

*Fixes 2.0.7

I want to push a little fix for my 2.0.7 update. It was very recent, and this fix won't touch many users. I found in practice that 1.asObservable() is ugly and has no big difference to ObservableInt(1) So I changed it to .obs() It is short and convenient for GetX users (which use .obs getter) to jump to MobX.

final x = 1.obs();
netlify[bot] commented 2 years ago

Deploy Preview for mobx canceled.

Name Link
Latest commit 65a784124f31f6379775a93b70f42dd59315ff40
Latest deploy log https://app.netlify.com/sites/mobx/deploys/62b37183d46deb0008044a02
codecov[bot] commented 2 years ago

Codecov Report

Merging #831 (65a7841) into master (4f98362) will decrease coverage by 0.15%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #831      +/-   ##
==========================================
- Coverage   98.80%   98.65%   -0.16%     
==========================================
  Files          56       56              
  Lines        1931     1931              
==========================================
- Hits         1908     1905       -3     
- Misses         23       26       +3     
Flag Coverage Δ
flutter_mobx 96.90% <ø> (-3.10%) :arrow_down:
mobx 98.32% <0.00%> (ø)
mobx_codegen 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...src/api/extensions/primitive_types_extensions.dart 0.00% <0.00%> (ø)
mobx/lib/src/core.dart 100.00% <ø> (ø)
flutter_mobx/lib/src/observer_widget_mixin.dart 92.30% <0.00%> (-7.70%) :arrow_down:

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 4f98362...65a7841. Read the comment docs.

subzero911 commented 2 years ago

@pavanpodila can you approve the MR?

pavanpodila commented 2 years ago

@pavanpodila can you approve the MR?

there seems to be a big drop in coverage. Can you please look into that @subzero911 ?

subzero911 commented 2 years ago

codecov/patch https://github.com/mobxjs/mobx.dart/pull/831/checks?check_run_id=6981802810 The check fails on lines 5, 12, 26, 33 These are function signatures - how am I supposed to test them? It seems to be impossible Tests for function bodies are written.

Anyway, I added some tests for typedefs (to ensure they are corresponding to their generic types).

codecov/project/flutter_mobx — 96.90% (-3.10%) compared to 4f98362 I hadn't touch the flutter_mobx project - how could it drop the coverage?

@pavanpodila it swears at observer_widget_mixin.dart - but it was changed in 2.0.6+1 version, not by me.