Skip to content
/ fluent Public

FluentJS: A tiny Facebook Flux library (< 100 LOC)

License

Notifications You must be signed in to change notification settings

twincl/fluent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FluentJS

FluentJS is a tiny Flux implementation we’re using in our site twincl.com. It has some good features:

  • Very tiny - less than 100 lines of code.
  • ES2015 class-based.
  • Can be used at server-side rendering. (For example, all twincl.com pages can be rendered at server side by appending a ?ssr=1 query parameter.)
  • Makes your code very terse. No more repetitive emitChange, add/removeChangeListener, ActionTypes constants, etc.
  • As close to Facebook Flux pattern and as few magic as possible.
  • Can be used with Facebook Flow type checker effectively. (For example, if you call an action creator or store method with wrong argument types, the Flow type checker will complain.)

If you already know Flux, a quick way to glimpse FluentJS is by looking at our fluent-chat example modified from the Facebook flux-chat code. This commit shows the code changes. As you can see, lots of repetitive code were removed.

Installation

To install FluentJS, type:

npm install --save fluent-js

Usage

See this page (English) or this page (中文).

About

FluentJS: A tiny Facebook Flux library (< 100 LOC)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published