Document dependency injection with Flags and typed environments
- Lingua principale
- Rust
- Stelle
- 9
- Fork
- 1
- Merge medio
- 11h 46m
- PR unite (30g)
- 62
Descrizione
## Summary
Document a standard dependency-injection pattern using `Flags` and a typed environment, without adding a dependency registry or replaceable effect executor to the runtime.
RFC 0012 deliberately leaves non-time I/O dependencies in application-owned state and construction. Users can already pass typed clients through `Flags`, but there is no end-to-end example showing how the same reducer uses live and mock implementations.
## Scope
- Define a small typed environment containing an I/O client.
- Pass the environment through `Flags` into program state.
- Run the same reducer with a live client and a deterministic mock.
- Use `TestStore` for pure reducer/effect assertions.
- Use `MockSource` or `TestDriver` where subscription input and lifecycle behavior matter.
The example must use existing seams. It must not introduce a global dependency registry, a general-purpose effect executor abstraction, or a clock abstraction.
## Acceptance criteria
- [ ] A runnable example injects a typed client through `Flags`.
- [ ] Live and mock implementations share the same application/reducer code.
- [ ] Tests demonstrate the intended boundary between `TestStore` and `TestDriver`.
- [ ] Documentation explains ownership, cloning, and where environment values should live.
- [ ] The example does not add new runtime contracts or public dependency traits owned by tears.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Start by reading RFC 0012 and locating the existing Flags, TestStore, MockSource, and TestDriver entry points. Done means a runnable example documents a typed client with live and mock implementations, demonstrates the TestStore/TestDriver boundary, and explains environment ownership and cloning without changing runtime contracts.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- rust
- Ambito
- documentation, testing
- Tipo di issue
- Documentazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 68/100