Quantcast
Channel: Lunar Logic Blog
Viewing all articles
Browse latest Browse all 22

Adventures while creating universal Reactjs application – Part 4 – Redux

$
0
0

Why Redux?

General idea

Let’s reduxify our app

You can now remove events and flux from the package.json.
And let’s add redux dependencies to our package.json by running: npm install –save redux react-redux redux-router redux-thunk.

Dispatcher

Actually dispatcher would not be needed anymore, so we can remove it:
rm src/AppDispatcher.js

Store

We will have one store class, but we will have two instances – one for client and one for server side:

Reducers


Action Types

Action Creators

Submission Page

Creating store

Client side

Server side

Full rendering server side



Full code accessible here Read all »


Viewing all articles
Browse latest Browse all 22

Trending Articles