Shivek Khurana
1 min readJul 8, 2018

--

This is a very broad question…

I don’t see anything wrong with having the middleware file in the Fractal folder. Example in the example above, the loginMiddleware.js can safely goto login/ directory.

When I need to applyMiddleware, I can simply import the file.

That being said, if every action/ component has a middleware attached to it, then Fractal might be confusing, and I’d simply extract them into their own folder.

I’ve personally never came across a use case with more than 4 custom middlewares. Will be happy to help if you can share more details about your problem.

--

--

Shivek Khurana
Shivek Khurana

Written by Shivek Khurana

🏋🏻‍♂️ Founder — Building Meta Blocks — The NFT evolution protocol | 🔫 Talks about 📜 code, 🏛 crypto, 🕸 web3 and 🪖 ed-tech | 👼🏼 Angel Investor | W

Responses (1)