Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 1.03 KB

README.md

File metadata and controls

31 lines (20 loc) · 1.03 KB

re-interval

A re-frame/ClojureScript library for creating intervals controlled by events.

Dependency

Add this to your project.clj:

Clojars Project

Usage

To create an interval:

(require '[re-interval.core :refer [register-interval-handlers]])
(register-interval-handlers :interval-prefix middleware timeout-in-ms)

To activate the interval, dispatch the event :interval-prefix/start. When active, an event :interval-prefix/tick will be dispatched every timeout ms.

To stop and restart, dispatch :interval-prefix/stop and :interval-prefix/restart, respectivelly.

Contributing / literate programming

As part of an exercise, I've created this library following literate programming techniques. For anyone interested, the documentation that generated the source is in the file project.org. Just need to connect to a REPL and run the code blocks :)