Closed nhunzaker closed 6 years ago
Merging #500 into master will decrease coverage by
2.78%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #500 +/- ##
==========================================
- Coverage 98% 95.21% -2.79%
==========================================
Files 29 27 -2
Lines 702 669 -33
Branches 137 130 -7
==========================================
- Hits 688 637 -51
- Misses 12 29 +17
- Partials 2 3 +1
Impacted Files | Coverage Δ | |
---|---|---|
packages/microcosm/src/ledger.js | 100% <ø> (+11.11%) |
:arrow_up: |
packages/microcosm/src/microcosm.js | 100% <100%> (ø) |
:arrow_up: |
packages/microcosm/src/agent.js | 100% <100%> (ø) |
|
packages/microcosm/src/effect.js | 100% <100%> (ø) |
:arrow_up: |
packages/microcosm/src/subject.js | 100% <100%> (ø) |
:arrow_up: |
packages/microcosm/src/domain.js | 100% <100%> (+2.08%) |
:arrow_up: |
packages/microcosm/src/registry.js | 100% <100%> (ø) |
:arrow_up: |
packages/microcosm/src/history.js | 100% <100%> (ø) |
:arrow_up: |
packages/microcosm/src/proto.js | 100% <100%> (ø) |
|
packages/microcosm-dom/test/engines/react.setup.js | ||
... and 7 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 d6492c5...1e37997. Read the comment docs.
+1 to the refactoring here. Personally, I'm not too interested in a public API for Agents - I can't think of a use case for cutting off your own class that extends Agent when you have Domains/Effects at your fingertips.
@dce Looks like I was missing coverage in a few areas. In 1e37997a I added a few more tests and added an assertion to warn users when they add a null domain/effect. This achieves complete coverage of the proto module.
@efatsi Agreed. I don't want to advertise it for the time being, but I am quite curious about how we could use it to create domains that do not rely on history.
Thanks everyone!
This commit adds a new class to describe the dispatch behavior: an agent. Agents receive action dispatches from history and can manage their own internal state:
I still haven't figured out the public API for Agents yet, but I think they will be a useful escape hatch for creating new types of Domain/Effect-like abstractions. I'm also curious if they could be used as a type of viewmodel class, but I'm not quite there yet.