signals_hooks

Integrate Preact-style signals with Flutter HookWidget lifecycles for reactive rebuilds.

803|85|Updated Nov 18, 2023
One-click install
npx skills add https://github.com/rodydavis/signals.dart --skill signals-hooks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: signals_hooks
Source: https://github.com/rodydavis/signals.dart/tree/main/.agents/skills/signals_hooks
Command: npx skills add https://github.com/rodydavis/signals.dart --skill signals-hooks

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It solves the friction of keeping Preact-style signals in sync with Flutter HookWidget lifecycles, so UI rebuilds stay correct and effects dispose automatically.

Core Features & Use Cases

  • Hook-first reactive signals for Flutter: Create and bind signals that rebuild widgets surgically as dependencies change.
  • Async-aware hooks: Manage async computations and streams through FutureSignal and AsyncSignal patterns.
  • Lifecycle-safe side effects: Register signal-driven effects that are disposed when the hook unmounts.
  • Collection and bridge hooks: Build reactive list/set/map/iterable/queue signals and bridge Flutter ValueNotifier/ValueListenable into signals.

Quick Start

Ask the assistant to generate a HookWidget example that uses useSignal with correct positional dependency keys and options, then renders a Text widget that updates when the signal changes.

Frequently Asked Questions about signals_hooks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Preact-style signals with Flutter HookWidget lifecycles?

To use Preact-style signals with Flutter HookWidget lifecycles, you bind signals using hooks that trigger surgical widget rebuilds. This ensures reactive UI state updates correctly while automatically disposing effects when the hook unmounts.

What's the best way to manage async state and streams in Flutter using signals?

Managing async state and streams in Flutter requires async-aware hooks using FutureSignal and AsyncSignal patterns. These hooks handle asynchronous computations and stream-driven updates, ensuring UI state remains reactive and synchronized throughout the widget lifecycle.

Can I bridge Flutter ValueNotifier and ValueListenable into reactive signals?

You can bridge Flutter ValueNotifier and ValueListenable into reactive signals using dedicated bridge hooks. This integration converts native Flutter listener objects into fine-grained signals, enabling surgical widget rebuilds within HookWidget implementations.

Does using signals_flutter hooks require manual disposal of side effects?

Using signals_flutter hooks does not require manual disposal of side effects. The system registers signal-driven effects that are automatically disposed when the hook unmounts, ensuring lifecycle-safe memory management within your Flutter application.

Why do my Flutter signal hooks fail to rebuild widgets correctly?

Flutter signal hooks fail to rebuild widgets correctly when the positional options pattern omits the dependency keys argument. Providing correct dependency keys ensures the HookWidget tracks signal changes and triggers surgical reactive rebuilds as expected.

Do I need to use a specific pattern when creating reactive collection signals in Flutter?

Creating reactive collection signals in Flutter requires using the positional options pattern with a dependency keys argument. This pattern supports building reactive list, set, map, iterable, and queue signals that correctly manage lifecycle updates within HookWidget.