원클릭으로
signals-preact-dart
Core reactive programming best practices and primitive definitions for preact_signals in Dart.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Core reactive programming best practices and primitive definitions for preact_signals in Dart.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Highly optimized Flutter UI bindings and GPU rendering for reactive signals.
Comprehensive hook utility functions integrating reactive signals seamlessly with flutter_hooks.
Comprehensive reactive state hooks for integration with flutter_hooks.
Standardized compiler diagnostics, static analysis lints, and automated IDE quick-fixes.
Use when you need to convert / rewrite existing HTML (from a file or url) into Jaspr code.
Use when working in a Jaspr project, on Jaspr components, or other Jaspr-related tasks. Contains fundamentals of writing Jaspr components and using HTML components.
| name | signals-preact-dart |
| description | Core reactive programming best practices and primitive definitions for preact_signals in Dart. |
This skill covers the core reactive programming primitives and implementation patterns of the preact_signals package.
| Related File | Description |
|---|---|
| signal.md | Standard writeable reactive state primitive containing value accessors, mutation mechanics, and basic custom options. |
| computed.md | Lazy, memoized read-only derived state signal tracking reactive dependencies dynamically. |
| effect.md | Synchronous observer managing active subscription loops, dynamic dependency updates, and lifecycle teardown. |
| readonly.md | Read-only signal views ensuring unidirectional data access flows. |
| batch.md | Transactional state mutation blocks optimizing reactive computations and preventing rendering/recompute churn. |
The signals library exposes five core functions which are the building blocks to model any reactive business logic.
signal(initialValue)Creates a new mutable signal container. You read a signal's value or subscribe to updates by accessing .value.
final counter = signal(0);
print(counter.value); // 0
counter.value = 1; // Mutates value and schedules dependent updates
.peek()Reads a signal's current value without subscribing to its mutations.
final counter = signal(0);
final logCount = signal(0);
effect(() {
print(counter.value);
// Read using peek to avoid subscribing/triggering loop
logCount.value = logCount.peek() + 1;
});
untracked(fn)Executes a callback that reads signals without subscribing to any of them.
final counter = signal(0);
final count = signal(0);
effect(() {
print(counter.value);
count.value = untracked(() => count.value + 1);
});
computed(fn)Combines the values of multiple signals into a lazy, memoized derived signal.
final first = signal('John');
final last = signal('Doe');
final fullName = computed(() => '${first.value} ${last.value}');
print(fullName.value); // John Doe
effect(fn)Orchestrates immediate synchronous side effects by running a callback and subscribing to any signals read within it.
final name = signal('Jane');
final dispose = effect(() => print('Hello $name'));
dispose(); // Clean up subscription
batch(fn)Groups multiple signal writes into a single transaction, executing all dependent computed evaluations and effects exactly once at the end.
final a = signal(0);
final b = signal(0);
batch(() {
a.value = 1;
b.value = 2;
});
Signal<T>A state primitive representing a mutable value that can be observed.
final count = signal(0);
count.value = 1; // Notifies all active subscribers/effects
Computed<T>A derived state primitive representing a read-only value calculated based on other signals. It is:
final count = signal(2);
final double = computed(() => count.value * 2);
EffectAn observer that executes a callback immediately and tracks read signals. It re-runs whenever any of the tracked signals change.
final dispose = effect(() {
print('Current count: ${count.value}');
});
dispose(); // Clean up subscription
isInitialized or check the initialization status before forcing a .peek() inside observers to avoid re-entrancy cycle crashes.