How to use rax-redux - 2 common examples

To help you get started, we’ve selected a few rax-redux examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alibaba / beidou / examples / with-rax-redux / client / index.jsx View on Github external
Set text
          
        
      
    );
  }
}

function mapStateToProps(state) {
  return {
    content: state.content,
    counter: state.counter,
  };
}

const App = connect(mapStateToProps)(Page);

class Entry extends Component {
  static async getStore(props) {
    // console.log(`request props: ${JSON.stringify(props, null, 2)}`);
    return createStore(
      combineReducers({
        content,
        counter,
      })
    );
  }

  static async getPartial({ store }) {
    // console.log(`request props: ${JSON.stringify(props, null, 2)}`);
    const html = (
github alibaba / rax / examples / redux / src / index.js View on Github external
}}>
          Set text
        
      
    ;
  }
}

function mapStateToProps(state) {
  return {
    content: state.content,
    counter: state.counter
  };
}

let App = connect(
  mapStateToProps
)(Page);

function counter(state = {
  count: 0
}, action = {}) {
  switch (action.type) {
    case 'counter/add':
      return Object.assign({}, state, {
        count: state.count + 1
      });
    case 'counter/minus':
      return Object.assign({}, state, {
        count: state.count - 1
      });
    default:

rax-redux

Official Rax bindings for Redux.

BSD-3-Clause
Latest version published 3 years ago

Package Health Score

57 / 100
Full package analysis

Popular rax-redux functions

Similar packages