A Functional Reactive Programming architecture with xstream, built for React apps used by Lookback's frontend. Heavily inspired by CycleJS.
Variant | Size |
---|---|
frap.js | 60 KB |
frap.min.js (minified) | 18 KB |
frap.min.js (minified & gzipped) | 4 KB |
See examples
directory for more code. Knowledge of how to program with streams is assumed.
We use:
- React as view, but you can use any view library that can draw from a single state object.
- Typescript, because we're not insane.
-
Install frap as a dependency from npm.
-
Require it from within your Typescript or Javascript files:
import { setup } from 'frap'; // or const { setup } = require('frap');
-
Grab the bundle from the
dist
directory and put in your app's directory structure. -
Add as a
<script>
tag in your HTML:<body> <!-- your app --> <script src="frap.min.js"></script> </body>
TBD.
npm install
npx tsc -w # Watch and compile TS
npm test
- Working example
- Proper types
- Proper bundle process
- More examples?
- More documentation