react + redux + RR
It uses https://gist.github.com/iNikNik/3c1b870f63dc0de67c38 for stores and actions.
1) create redux
const redux = createRedux(state);
2) get requireAccess func => bindCheckAuth to redux
import React, { PropTypes } from 'react'; | |
const SegmentedControl = ({ input, disabled, heading, required, className, items, name, meta: { touched, error } }) => ( | |
<fieldset className={`form__field ${className || ''}`}> | |
<legend className="form__label"> | |
{heading}{required ? (<span>*</span>) : null} | |
{ (touched && error) ? ( | |
<span className="form__error"> {error}</span> | |
) : null } |
import React, { Navigator } from 'react-native'; | |
import RouterRegistry from './RouterRegistry'; | |
import navigateTo from './routerActions'; | |
const BACK = 'BACK'; | |
const FORWARD = 'FORWARD'; | |
class Router extends React.Component { |
class MainApp extends Component { | |
constructor(props) { | |
super(props); | |
} | |
renderScene(route, navigator) { | |
var Component = route.component; | |
return ( | |
<Component route={route} navigator={navigator} /> | |
); |
import { connect } from 'redux/react'; | |
import { ActionTypes } from 'constants/myConstants'; | |
const { CHANGE_STATUS } = ActionTypes; | |
@connect(reduxState => ({ | |
// Query for specific action | |
statusIsLoading: reduxState.loading.isLoading(ActionTypes.CHANGE_STATUS), | |
// Query for any action | |
isLoading: reduxState.loading.isLoading() |
react + redux + RR
It uses https://gist.github.com/iNikNik/3c1b870f63dc0de67c38 for stores and actions.
1) create redux
const redux = createRedux(state);
2) get requireAccess func => bindCheckAuth to redux
/** | |
* Basic proof of concept. | |
* - Hot reloadable | |
* - Stateless stores | |
* - Stores and action creators interoperable with Redux. | |
*/ | |
import React, { Component } from 'react'; | |
export default function dispatch(store, atom, action) { |
This document is a collection of concepts and strategies to make large Elm projects modular and extensible.
We will start by thinking about the structure of signals in our program. Broadly speaking, your application state should live in one big foldp
. You will probably merge
a bunch of input signals into a single stream of updates. This sounds a bit crazy at first, but it is in the same ballpark as Om or Facebook's Flux. There are a couple major benefits to having a centralized home for your application state:
/** | |
* World's simplest express server | |
* - used to serve index.html from /public | |
*/ | |
var express = require('express'); | |
var serveStatic = require('serve-static'); | |
var app = express(); | |
app.use(serveStatic(__dirname + '/public')); |