GithubHelp home page GithubHelp logo

react-app-tools's Introduction

TODO

  • document react features
    • <this.props.foo />
    • call methods on instances using refs

App Architecture

Stores

Two ways to return data:

  • immediate/changed
setState({foos: store.getFoos()});
store.on('foos-changed', function () { this.setState({foos: store.getFoos()}); });
store.loadFoos();
  • promise
store.loadFoos().then(function (data) {
  this.setState({foos: data});
});

Optimistic load: when data is required, store can return previous data, query for new data and emit 'changed' when it arrives.

Optimistic save: store can e.g. edit collections immediately to improve user experience (more problematic)

If a store emits a 'changed' event every time something is changed, everybody can update via this.setState().

Both serverside and clientside pagination (or a combination) can be supported transparently to a grid

Controller Views

Controller views have state. State is loaded from

Views

Views

  • receive parent state via props;
  • communicate user interactions via callbacks:
<SomeView foos={this.state.foos} onEdited={this.onFooEdited} />

Architecture

Server interface

Components

Grid

Filters

  • filters before the grid
  • filters in column headings

Filter specification:

{
  key: 'foo',
  label: '- Foo -',
  type: 'input|range|select|multiselect|custom',
  
  // for 'select' / 'multiselect'
  choices: [{l: 'foo', v: 'bar'}, {l: 'foo', v: 'bar'}, {l: 'foo', v: 'bar'}],
  // - or -
  choices: callable_returnuing_promise().then(function (data) {
      return data.map(function (el) {
          return {l: el.foo, v: el/bar};
      })
  }),
  
  // for 'custom'
  widget: React.createClass({ ... })
}

Form

Lfecycle

Validation

react-app-tools's People

Contributors

pthorn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.