GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - scriptoLLC/barracks-react: Flux off even faster!

BranchesTags
Open more actions menu

Latest commit

 

History

18 Commits
18 Commits

Folders and files

NameName
Last commit message
Last commit date
test
test
 
 
.agignore
.agignore
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
barracks-react.d.ts
barracks-react.d.ts
 
 
barracks-react.js
barracks-react.js
 
 
example.js
example.js
 
 
package.json
package.json
 
 

Repository files navigation

barracks-react

An action dispatcher for React that provides for unidirectional dataflows. Intended to be very small and provide a small amount of cognative overhead in providing an "actions up, data down" type model for React. Built on top of barracks.

Usage

const React = require('react')
const ReactDOM = require('react-dom')
const bearact = require('./')

const model = {
  namespace: 'example',
  state: {
    hello: ''
  },
  reducers: {
    setHello: (state, data) => ({hello: data.value})
  }
}

const Main = React.createClass({
  handleChange: function (evt) {
    this.props.send('setHello', {value: evt.target.value})
  },
  render: function () {
    return React.createElement('div', {}, [
      React.createElement('h1', {}, `Hello, ${this.props.model.hello}`),
      React.createElement('br', {}, null),
      React.createElement('input', {value: this.props.model.hello, onChange: (evt) => this.handleChange(evt)}, null)])
  }
})

const main = React.createElement(bearact(Main, model))
const mount = document.createElement('div')
document.body.appendChild(mount)
ReactDOM.render(main, mount)

License

Copyright © 2016 Scripto, licenced under the Apache-2.0 license

About

Flux off even faster!

Resources

Readme
License
Activity
Custom properties

Stars

5 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.