Dev log for 11/14/16

Another day of 90% coding. These are the days you feel more productive than usual.

  • Continuation of getting redux to work for the application.
  • We are using thunkMiddleware as some of our actions require taking to the signalR hub whose methods return a Promise.
  • Also, found a cool Redux dev tool with which you can validate your state after each action dispatch. You’ll use them in the main App component as follows:
import React from 'react';
import {render} from 'react-dom';
import thunkMiddleware from 'redux-thunk';
{ createStore ,applyMiddleware,compose } from 'redux'
{ Provider } from 'react-redux'
class App extends React.Component {
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;

let store = createStore(login, composeEnhancers(applyMiddleware(thunkMiddleware)));

<Provider store={store}>
</Provider>, document.getElementById('app'));
  • sinonjs is an awesome tool that you makes writing test-spy even easier. I’ll add more details on that in an upcoming post.
  • One of the thing we are yet to finalize is where do we post a redirect to new path within the react-router and redux. For now, we are doing as part of the Component lifecycle functions but it looks dirty as there’s no clear separation of concern.