lookback / frap

A little functional reactive architecture for JS apps.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Frap

Frap – "Functional Reactive App"

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

Examples

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

Via npm

  1. Install frap as a dependency from npm.

  2. Require it from within your Typescript or Javascript files:

    import { setup } from 'frap';
    // or
    const { setup } = require('frap');

Browser script tag

  1. Grab the bundle from the dist directory and put in your app's directory structure.

  2. Add as a <script> tag in your HTML:

    <body>
      <!-- your app -->
      <script src="frap.min.js"></script>
    </body>

Get started

TBD.

Develop

npm install
npx tsc -w # Watch and compile TS

Tests

npm test

To Do

  • Working example
  • Proper types
  • Proper bundle process
  • More examples?
  • More documentation

About

A little functional reactive architecture for JS apps.


Languages

Language:TypeScript 95.5%Language:JavaScript 4.5%