Document dependency injection with Flags and typed environments
- 主要语言
- Rust
- 星标
- 9
- 派生
- 1
- 平均合并
- 11 小时 46 分钟
- 30 天内合并 PR
- 62
描述
## 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.
贡献指南
调研方向
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.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- rust
- 领域
- documentation, testing
- Issue 类型
- 文档
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 68/100