Create a gist now

Instantly share code, notes, and snippets.

Embed
redux_templates
import {createAction} from 'redux-actions'
import {METHOD_GET, METHOD_POST, METHOD_PUT, createApiMeta} from '../../../common/js/actions/helpers/api';
export const aaaGet = createAction('AAA_GET',
() => ( null ),
(id) => createApiMeta(`/api/company_branches/${id}`, null, METHOD_GET));
import React, {PropTypes} from 'react';
export default class Aaa extends React.Component {
static propTypes = {};
constructor(...args) {
super(...args);
}
componentDidMount() {
}
componentDidUpdate(prevProps, prevState) {
}
componentWillUnmount() {
}
render() {
return (
<div>
</div>
);
}
}
import React, {PropTypes} from 'react';
import {connect} from 'react-redux';
import {defaultMapDispatchToProps} from '../../actions/index';
class AaaPage extends React.Component {
static propTypes = {};
constructor(...args) {
super(...args);
}
componentDidMount() {
}
componentDidUpdate(prevProps, prevState) {
}
componentWillUnmount() {
}
render() {
return (
<div>
</div>
);
}
}
function mapStateToProps(state) {
return {};
}
export default connect(
mapStateToProps,
defaultMapDispatchToProps,
)(AaaPage);
import {handleActions} from 'redux-actions';
import {clearState} from '../../../common/js/reducers/helper/state';
export const aaas = handleActions({
AAAAS_GET: (state, action) => (action.payload ? [...state, ...action.payload] : state),
CLEAR_STATE: clearState('aaas', []),
}, []);
export const aaa = handleActions({
AAA_GET: (state, action) => (action.payload || state),
CLEAR_STATE: clearState('aaa', null),
}, null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment