flowponent
A small library for Preact 10.x (and React - see "Usage with React") for defining workflow-like evolving views via generators.
Here's the canonical counter example (also available at Codesandbox):
;; const App = ; ;
For a more involved one see here's a Codesandbox demonstrating composition, additional props & cleanups upon unmount:
Installation
$ npm install --save flowponent
Usage with React
The use flowponent with React, import from "flowponent/react"
instead of "flowponent"
:
;;; const App = ; ;
See Also
- The tweet with the initial idea, but still using async generators.
- For a more sophisticated approach check out
concur-js
from which this librarystoleborrowed further ideas 🙂
License
This library is licensed under the MIT license. See LICENSE.