0.6.3 • Published 3 years ago

redux-easy-app v0.6.3

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

redux-easy-app

This library can help you reduce the boilerplate of a Redux isomorphic app to the minimum.

Installation

You can install the package using:

npm install redux-easy-app

However, if you are starting to write an app from scratch, you may consider downloading the redux-app-skeleton, which depends on this module and already uses the functions explained in the following section.

Redux'(s?) function wrappers

redux-easy-app exposes only three functions:

createContainer()

Binds a component to his props and actions.

You may want use this one on every component that interacts in any way with the state of the application.

createContainer(ExampleComponent, SomeActions, mapStateToProps);

renderClientApp()

Renders the app in the browser, given its routes and reducers.

renderClientApp({
    routes,
    reducers,
    appRootElement
});

startServerApp()

This one needs a larger number of options but takes care of a lot of things: isomorphism, data pre-fetch, state push into the tree of routes.

You have to provide an instance of an Express app as first argument. The request object will be internally used to decide which route has been requested and fetch the data accordingly, the response object will be used to send the rendered HTML.

The viewFilename option refers to a nunjucks template file, usually the index.html of your app. In the future, other template engines will be supported too.

startServerApp(app, {
    routes,
    reducers,
    routesFetchersMap,
    viewsFolderPath,
    viewFilename
});

The option routesFetchersMap should be an array of objects having the format specified in this example.

Given a certain route, the server app will call the function that you specified as the func parameter and then the page will be rendered with the fetched data.

0.6.3

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago

0.4.3

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.4.2

3 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.14

6 years ago

0.2.13

6 years ago

0.2.12

6 years ago

0.2.11

6 years ago

0.2.10

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.30

8 years ago

0.1.29

8 years ago

0.1.28

8 years ago

0.1.27

8 years ago

0.1.26

8 years ago

0.1.25

8 years ago

0.1.24

8 years ago

0.1.23

8 years ago

0.1.22

8 years ago

0.1.21

8 years ago

0.1.20

8 years ago

0.1.19

8 years ago

0.1.18

8 years ago

0.1.17

8 years ago

0.1.16

8 years ago

0.1.15

8 years ago

0.1.14

8 years ago

0.1.13

8 years ago

0.1.12

8 years ago

0.1.11

8 years ago

0.1.10

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.1

9 years ago