FxDart 入门

一门重实践的课程。每一课都是一段简短讲解,配有实时演示和 playground —— 代码由真正的 Dart 编译器编译,并在你的浏览器中运行。 你可以按顺序学完各个章节,也可以直接跳到下面的任意函数。

初次接触?选哪一面 开始 — 手头的数据、有上限的 I/O、随时间到来的事件,或作为值的失败。 然后是 pull 入门: fxmapfiltertaketoList, 再进入 concurrent任务: 防抖搜索 · 有上限的并发 fetch

📖 函数式编程理论 —— 这门课程背后的教科书 →

📒 看看实际效果:Daily Ledger —— 用 FxDart 构建的完整应用 →

章节 1 · 快速上手

管道模型:惰性构建,由终结操作符触发执行。

章节 2 · 生成序列

可以作为管道起点的数据源。

章节 3 · 转换

惰性地重塑每个元素。

章节 4 · 过滤 & 去重

只保留你需要的部分。

章节 5 · 切片

滑动窗口、前缀、后缀与分块。

章节 6 · 组合

多个序列进,一个序列出。

章节 7 · 聚合

拉动整条管道并产出结果的终结操作符。

章节 8 · 取值 & 判定

取出单个值,以及对元素做判定。

章节 9 · 对象(Map)函数

FxTS 的对象工具函数,移植到 Dart 的 Map 上。

章节 10 · 函数工具

组合子与辅助函数。

章节 11 · 异步 & 并发

FxAsyncIterable 模型 —— FxDart 的看家本领。

章节 12 · 实用工具

限流与随机。

章节 13 · Typed errors

The Kotlin Arrow approach, ported: either, Raise, bind, ensure, error accumulation with Nel, and pipeline-fused validation. Straight-line code, typed failures, no wrapper tower.

章节 14 · Event streams (push)

FxDart's push side — Rx-style operators over plain Dart Streams, bridging into the pull pipelines.

章节 15 · Jobs

Cross-surface programs — the reason to import one package rather than three.