hihook 0.1.0 copy "hihook: ^0.1.0" to clipboard
hihook: ^0.1.0 copied to clipboard

High-level hook abstraction framework with dependency graphs, transactions, metrics, and remote hooks.

HiHook #

A high-level hook pipeline framework for Dart. Build extensible middleware chains with dependency resolution, conditions, and transactions.

Features #

  • Hook Pipeline — Pre/Main/Post phases with priority ordering
  • Dependency Graph — Topological sort with cycle detection
  • Conditions — Composable filters with &, |, ~ operators
  • Transactions — Savepoints and automatic rollback
  • Plugin System — Bundle hooks for reuse

Quick Start #

final engine = HiEngine();

// Register a simple hook
engine.register(HiHook(
  uid: 'logger',
  events: ['read', 'write'],
  handler: (payload, ctx) {
    print('${ctx.event}: ${payload.key}');
    return const HiContinue();
  },
));

// Emit an event
await engine.emit('write', HiPayload(key: 'user:1', value: data));

Plugins #

// Install pre-built plugins
Base64Plugin().install(engine);  // Encode/decode values
TtlPlugin().install(engine);     // Time-to-live expiration
LruPlugin().install(engine);     // Access tracking

Transactions #

await engine.transaction((tx) async {
  await tx.emit('write', payload1, compensate: () => delete(key1));
  await tx.emit('write', payload2, compensate: () => delete(key2));
  // On failure: compensations run in reverse order
});
0
likes
150
points
141
downloads

Publisher

verified publisherpathverse.ca

Weekly Downloads

High-level hook abstraction framework with dependency graphs, transactions, metrics, and remote hooks.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

collection, meta

More

Packages that depend on hihook