Goal
ใช้ Effect-TS สำหรับ functional programming ใน TypeScript ด้วย type-safe error handling, dependency injection, และ composable effects
Scope
ใช้สำหรับ functional programming, error handling, dependency injection, และ composable effects ใน TypeScript
Execute
- ติดตั้ง Effect-TS ด้วย
bun add effect - อ่าน
guide/installation.mdสำหรับการติดตั้งและ setup - อ่าน
guide/quick-start.mdสำหรับเริ่มต้นใช้งาน - อ่าน
guide/key-concept.mdสำหรับแนวคิดหลัก - อ่าน
guide/how-it-works.mdสำหรับวิธีการทำงาน - อ่าน
key-concepts/effect.mdสำหรับ effect definitions - อ่าน
key-concepts/service.mdสำหรับ service และ dependency injection - อ่าน
key-concepts/runtime.mdสำหรับ runtime และ execution - อ่าน
key-concepts/error-handling.mdสำหรับ error handling - อ่าน
guide/configuration.mdสำหรับการตั้งค่า - อ่าน
references/configuration.mdสำหรับ tsconfig และ project configuration - ตั้งค่า TypeScript สำหรับ Effect-TS
- อ่าน
guide/features.mdสำหรับ features ที่มี - อ่าน
guide/patterns.mdสำหรับ patterns ทั่วไป - ใช้ effects สำหรับ async operations
- อ่าน
principles/error-first.mdสำหรับ error-first principle - อ่าน
guide/best-practices.mdสำหรับ best practices - ใช้ type-safe error handling
- อ่าน
guide/integration.mdสำหรับ framework integration - อ่าน
guide/architecture.mdสำหรับ system architecture - อ่าน
guide/structure.mdสำหรับ project structure - อ่าน
guide/troubleshooting.mdสำหรับปัญหาทั่วไป - อ่าน
references/api.mdสำหรับ API reference - อ่าน
references/cli.mdสำหรับ CLI commands
Rules
- ใช้
bun add effectสำหรับ installation - ใช้
bun add -D @effect/schemaสำหรับ schema validation - ใช้ backticks สำหรับ
Effect.sync(),Effect.try(), commands - ใช้ code blocks สำหรับ effect examples
- ใช้ ansi markdown diagrams สำหรับ flow และ architecture
- ใช้ pure functions เสมอ
- หลีกเลี่ยง side effects ใน pure code
- ใช้ composition สำหรับ complex logic
- ใช้ Effect สำหรับ error handling
- ใช้ type-safe error types
- ใช้ recovery mechanisms สำหรับ error recovery
Expected Outcome
- Code ที่ type-safe และ functional
- Error handling ที่ robust และ predictable
- Dependency injection ที่ clean และ testable
- Effects ที่ composable และ maintainable