Techiio-author
Started by Jimmy LittleSep 25, 2021

Open
How to import redux compose to bundle all middleware in a nodejs API

2 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 2 VIEWES SHARE

I've looked at code using ES6 where they're importing compose from redux to register/init all the middleware.

For example the server.js file might look like:

import express from 'express'
import { compose } from 'redux'
import app from './app'

compose(app)(express()))

The above code is in ES6, how can I do it the non ES6 way where the imports are utilizing 'require'.

1 Replies

Techiio-commentatorNurjaman Shekh replied 2 months ago0 likes0 dislikes

If you go through this link I think your problem will be solved. https://redux.js.org/api/applymiddleware

You must be Logged in to reply
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance