Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Effects in custom middleware #956

Open
sheheryar-pirzada opened this issue Dec 15, 2021 · 3 comments
Open

Effects in custom middleware #956

sheheryar-pirzada opened this issue Dec 15, 2021 · 3 comments
Labels

Comments

@sheheryar-pirzada
Copy link

📚 Documentation

I've created a middleware for auth refresh and I have to manually add actions to blacklist from it. Is there some way to get a list of just the effects?

@semoal
Copy link
Member

semoal commented Dec 15, 2021

Hi!

  createMiddleware: (rematchBag) => (store) => (next) => (action) => {
    // do something here
    return next(action);
  },

Inside rematchBag you have access to models, you could map all the models and directly models.map(model => model.effects)

Hope this helps you!

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 16, 2022
@olso-nordsec
Copy link

Please ignore the ugly proof of concept
But if you are willing to use redux-thunk

Screenshot 2022-04-27 at 15 56 04

Screenshot 2022-04-27 at 15 56 17

Why the async? Try it without it, you will get runtime dependency cycle

@stale stale bot removed the wontfix label Apr 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants