erikras / react-redux-universal-hot-example

A starter boilerplate for a universal webapp using express, react, redux, webpack, and react-transform
MIT License
12k stars 2.5k forks source link

clientMiddleware #1256

Open majidkarimizadeh opened 8 years ago

majidkarimizadeh commented 8 years ago

HI... can somebody explain how client middleware work and some function like get and post that we use in promie : client => client.get('/posts') where are they? tnx

bertho-zero commented 8 years ago

Hi,

You can look in src/helpers/ApiClient.js and middleware/clientMiddleware.js

majidkarimizadeh commented 8 years ago

Hi and thanks for your answer... When i use the promise and api call i get this error TypeError: Invalid attempt to destructure non-iterable instance Do you know any thing about this...? Thanks a lot

roof12 commented 8 years ago

When I started with this project, I found ApiClient.js/clientMiddleware.js to be one of the harder areas to understand. Brushing up on Redux middleware will help.

@bertho-zero linked the appropriate files. It's hard to know what your error is without more information. clientMiddleware expects a type parameter with an array of three action types. See src/redux/modules/widgets.js. Perhaps that is the problem?