FxDart 101
実践型のコースです。各レッスンはライブデモとプレイグラウンドを備えた短い講義で、 コードは本物の Dart コンパイラでコンパイルされ、ブラウザ上で動作します。 セクションを順に進めても、下記の任意の関数に飛んでもかまいません。
fx →
map →
filter →
take →
toList、
それから
concurrent。
ジョブ:
デバウンス検索
·
上限つき並行 fetch。
📖 関数型プログラミング理論 — このコースの土台となる教科書 →
📒 実際のアプリで確認: Daily Ledger — FxDart で作られたフル機能アプリ →
セクション 1 · はじめに
パイプラインモデル。遅延して組み立て、終端演算子で実行します。
セクション 2 · シーケンスの生成
パイプラインの起点となるソース。
セクション 3 · 変換
各要素を遅延評価で作り変えます。
セクション 4 · フィルタリング & 重複除去
必要なものだけを残します。
- where
- whereNot
- nonNulls
- distinct
- distinctBy
- uniqStrict
- uniqAdjacent
- takeUniqBy
- difference
- differenceBy
- intersection
- intersectionBy
- compress
セクション 5 · スライス
ウィンドウ、先頭、末尾、そしてチャンク。
- take
- takeLast
- takeWhile
- takeWhileRight
- takeUntilInclusive
- skip
- dropRight
- skipWhile
- dropWhileRight
- dropUntil
- slice
- chunk
- windowed
- pairwise
- split
セクション 6 · 結合
複数のシーケンスを入力し、1つを出力します。
- append
- prepend
- concat
- zip
- zip3
- zipWith
- indexed
- …WithIndex (map, filter, fold)
- transpose
- reverse
- fork
- tee
- tee3
- ifEmpty
セクション 7 · 集約
パイプラインを引き出して値を生成する終端演算子。
- reduce
- fold
- foldRight
- reduceLazy
- sum
- sumBy
- average
- averageBy
- min
- max
- maxBy
- minBy
- count
- join
- groupBy
- groupedBy
- indexBy
- countBy
- foldBy
- foldByOrSkip
- countWhere
- sort
- sortBy
- sortByDesc
- partition
セクション 8 · アクセス & 述語
単一の値を取り出し、要素を判定します。
- firstOrNull
- lastOrNull
- elementAtOrNull
- firstWhereOrNull
- indexWhere
- contains
- isEmpty
- every
- any
- predicates (isNull, isString, …)
セクション 9 · オブジェクト(Map)関数
FxTS のオブジェクトユーティリティを Dart の Map 向けに移植したもの。
- fromEntries
- omit
- pick
- omitBy
- pickBy
- prop
- props
- mapValues
- evolve
- compactObject
- resolveProps
- isMatch
- matches
セクション 10 · 関数ユーティリティ
コンビネータとヘルパー。
- identity
- always
- tap
- apply
- juxt
- fxPipe
- memoize
- negate
- not
- predicate combinators
- when
- unless
- throwError
- throwIf
- cases
- add
- gt · gte · lt · lte
- delay & sleep
- unicodeToList
- curried & uncurried
セクション 11 · 非同期 & 並行処理
FxAsyncIterable モデル — FxDart の真骨頂。
- toAsync
- async variants (mapAsync, …)
- Stream bridges
- concurrent
- mapConcurrent
- concurrentPool
- retry
- timeout
- using
- concurrent or parallel
- parallel
セクション 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.
- typed errors — full guide
- Either
- Either combinators
- either & Raise scope
- nullable
- NonEmptyList (Nel)
- accumulation (zipOrAccumulate, …)
- Either × pipelines
セクション 14 · Event streams (push)
FxDart's push side — Rx-style operators over plain Dart Streams, bridging into the pull pipelines.
- fxEvents
- constructors
- peek · whenComplete
- sampleOn
- combineLatest
- withLatestFrom
- switchMap
- mergeMap
- switchLatest
- mergeScan
- race
- waitAll
- combine
- stopOn
- chunkOn
- windowOn
- groupsBy
- spaceBy
- debounceOn
- retryOn
- onErrorResume
- attempt
- mapEither
- separated
- share
- shareReplay
- LiveValue
- FxSubscriptions
- materialize
セクション 15 · Jobs
Cross-surface programs — the reason to import one package rather than three.