jeffbski / redux-logic

Redux middleware for organizing all your business logic. Intercept actions and perform async processing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hook for optimistic ui updates

joshalling opened this issue · comments

I want to do optimistic updates on a toggle switch while also debouncing the api call. Unfortunately, the logic waits for the debounce timeout before running any code, so I can't to the optimistic update in there. I thought of using thunk to dispatch my optimistic update and then logic action immediately after, but it doesn't feel right to have initial update in my actions and the error revert in my logics.

Is there a current way that I could achieve this with redux-logic?

If not, would it be possible to have a hook that runs before the the debounce timeout?