Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fux

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fux

  • 0.7.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

fux

Fux is a user interface library with uni-directional dataflow.

Install

NPM

npm install --save-dev fux

Starter Project

  • download example.zip from Github
  • extract and run npm run dev
  • this starts a minimal build process with preconfigured babel and browserify
  • point your browser to localhost:8080 to view the examples
  • or use this as template for your own project

Usage

import { element, cycle, views, scopes, decorators } from 'fux';

const { component, controller, dispatchChangeSets } = decorators;
const App = component(
  dispatchChangeSets(),
  controller({
    inc: ['/count', count => count + 1]
  }),
)(function({ context }) {
  return (
    <div>
      <input type='button' onClick='inc'/>
      {context.get('/count')}
    </div>
  );
});

const view = views.dom(document.body, App);
const scope = scopes.value({ count: 0 });

cycle(view, scope);

Architecture

overview

  • Context

    • immutable data structure (struct)
    • holds application context
    • emitted from scopes, when they have new data
    • consumed from views
  • PatchSet

    • list of json patch objects
    • used like actions in flux architecture
    • used to manipulate Context
    • emitted from views, when they change state
    • consumed from scopes
  • Scope

    • state container
    • representation of data that may change over time (stream)
  • View

  • Component

    • stateless
    • dispatches side effects to scopes
    • additional functionality added through decorators

Api

fux

fux.scopes
fux.views
fux.decorators

Hack

git clone https://github.com/freemountain/fux
cd fux
npm install
npm run dev

... and click here

License

The MIT License (MIT)

Keywords

FAQs

Package last updated on 11 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc