@gyral/time
v0.3.6
Published
Gyral time: delays, debounces and wall-clock ticks (every) as commands.
Readme
@gyral/time
Gyral time: delays, debounces, wall-clock ticks (every) and animation frames as commands, so timing logic stays in pure update functions and tests run on virtual time.
Install
pnpm add @gyral/time @gyral/coreExample
import { debounce, delay } from '@gyral/time';
// In an update:
// Typed: (s, m) => [{ ...s, query: m.text }, [debounce(300, { _tag: 'Search' })]],
// Saved: (s) => [{ ...s, toast: true }, [delay(2000, { _tag: 'HideToast' })]],delay and debounce run on a delay-only driver (also named time, so tests substitute it
the same way), so an app that only delays doesn't bundle the every code.
Documentation
Guides and API reference: gyral.dev. Source, issues and the consumer setup guide (packages, Vite preset, server rendering): github.com/gyraljs/gyral.
Status: 0.x, on npm. Breaking changes to the public API come only in a new minor version, with a migration guide.
License
MIT © Mike Zupper. See LICENSE and NOTICE (Cycle.js attribution). Gyral, gyraljs and the Gyral logo are trademarks of Mike Zupper.
