cell_flow 1.0.0-rc.6 copy "cell_flow: ^1.0.0-rc.6" to clipboard
cell_flow: ^1.0.0-rc.6 copied to clipboard

Orchestration Layer (Flow) for the Cell Framework — 90+ forensic-grade operators (asyncMap, switchMap, debounce) for reactive signal processing.

example/cell_flow_example.dart

// Copyright (c) 2025-Present Lee Man Hoi Simon. See the AUTHORS file
// for details. Use of this source code is governed by a MIT or
// Apache-2.0 license that can be found in the LICENSE file.

import 'package:cell_flow/cell_flow.dart';

/// Minimal, runnable quick start for `cell_flow`.
///
/// Shows a search-style pipeline in a few lines:
/// 1. events enter the graph through an ingress,
/// 2. a fluent chain normalizes, gates, and debounces them, and
/// 3. an observer reacts to the accepted values.
Future<void> main() async {
  // 1. Ingress: external events enter the reactive graph here.
  final query = Cell.ingress<String>();

  // 2. Fluent pipeline: normalize, gate, and debounce.
  final accepted = query.cell
      .map<String, String>(project: (q) => q.trim().toLowerCase())
      .filter<String>(test: (q) => q.length >= 2)
      .debounce<String>(duration: const Duration(milliseconds: 100));

  // 3. Observe: react to accepted values.
  Cell.observe<Pulse<String>>(
    source: accepted.cell,
    effect: (pulse) => print('Accepted: ${pulse.payload}'),
  );

  await query.emitAsync('  Dart  ');
  await query.emitAsync('x'); // filtered out (too short)
  await Future<void>.delayed(const Duration(milliseconds: 200));
}
0
likes
160
points
189
downloads

Documentation

Documentation
API reference

Publisher

verified publisheropencell.dev

Weekly Downloads

Orchestration Layer (Flow) for the Cell Framework — 90+ forensic-grade operators (asyncMap, switchMap, debounce) for reactive signal processing.

Homepage
Repository (GitHub)
View/report issues

Topics

#reactive #streams #forensic-traceability #state-management #async-orchestration

License

Apache-2.0, MIT (license)

Dependencies

cell

More

Packages that depend on cell_flow