Skip to content

Commit 3b069be

Browse files
committed
Remove redundant Map and Transform example, add inline link to listen_it operators
1 parent 9301029 commit 3b069be

File tree

3 files changed

+2
-41
lines changed

3 files changed

+2
-41
lines changed

code_samples/lib/command_it/command_chaining_operators.dart

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -63,37 +63,6 @@ class FilteredPipeManager {
6363
}
6464
// #endregion filter_example
6565

66-
// #region map_example
67-
class MappedPipeManager {
68-
late final rawInputCommand = Command.createSync<String, String>(
69-
(s) => s,
70-
initialValue: '',
71-
);
72-
73-
late final processCommand = Command.createAsync<String, List<Result>>(
74-
(query) => api.search(query),
75-
initialValue: [],
76-
);
77-
78-
late final ListenableSubscription _subscription;
79-
80-
MappedPipeManager() {
81-
// Normalize input before piping
82-
_subscription = rawInputCommand
83-
.map((s) => s.trim().toLowerCase())
84-
.where((s) => s.isNotEmpty)
85-
.debounce(Duration(milliseconds: 300))
86-
.pipeToCommand(processCommand);
87-
}
88-
89-
void dispose() {
90-
_subscription.cancel();
91-
rawInputCommand.dispose();
92-
processCommand.dispose();
93-
}
94-
}
95-
// #endregion map_example
96-
9766
void main() {
9867
// Examples compile but don't run
9968
}

docs/documentation/command_it/command_chaining.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ saveCommand.pipeToCommand(refreshCommand); // Works! Calls refreshCommand.run()
115115

116116
## Combining with listen_it Operators
117117

118-
The real power comes from combining `pipeToCommand` with `listen_it` operators:
118+
The real power comes from combining `pipeToCommand` with [listen_it operators](/documentation/listen_it/operators/overview) like `debounce`, `where`, and `map`:
119119

120120
### Search with Debounce
121121

@@ -125,10 +125,6 @@ The real power comes from combining `pipeToCommand` with `listen_it` operators:
125125

126126
<<< @/../code_samples/lib/command_it/command_chaining_operators.dart#filter_example
127127

128-
### Map and Transform
129-
130-
<<< @/../code_samples/lib/command_it/command_chaining_operators.dart#map_example
131-
132128
## Subscription Management
133129

134130
`pipeToCommand` returns a `ListenableSubscription`. Always store and cancel it to prevent memory leaks.

docs/es/documentation/command_it/command_chaining.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ saveCommand.pipeToCommand(refreshCommand); // ¡Funciona! Llama refreshCommand.
115115

116116
## Combinando con Operadores de listen_it
117117

118-
El verdadero poder viene de combinar `pipeToCommand` con operadores de `listen_it`:
118+
El verdadero poder viene de combinar `pipeToCommand` con [operadores de listen_it](/es/documentation/listen_it/operators/overview) como `debounce`, `where`, y `map`:
119119

120120
### Búsqueda con Debounce
121121

@@ -125,10 +125,6 @@ El verdadero poder viene de combinar `pipeToCommand` con operadores de `listen_i
125125

126126
<<< @/../code_samples/lib/command_it/command_chaining_operators.dart#filter_example
127127

128-
### Map y Transform
129-
130-
<<< @/../code_samples/lib/command_it/command_chaining_operators.dart#map_example
131-
132128
## Gestión de Suscripciones
133129

134130
`pipeToCommand` retorna un `ListenableSubscription`. Siempre guárdalo y cancélalo para prevenir memory leaks.

0 commit comments

Comments
 (0)