项目作者: lookback

项目描述 :
A little functional reactive architecture for JS apps.
高级语言: TypeScript
项目地址: git://github.com/lookback/frap.git
创建时间: 2019-04-26T07:24:37Z
项目社区:https://github.com/lookback/frap

开源协议:

下载



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:

    1. import { setup } from 'frap';
    2. // or
    3. 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:

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

Get started

TBD.

Develop

  1. npm install
  2. npx tsc -w # Watch and compile TS

Tests

  1. npm test

To Do

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