I have a cart reducer function with add, update and delete cases. I also have a product array within the redux store. When there are two items added to the product array, i
Most certainly! Reducers should be pure functions, so the logic must be pure as well. This means there should be zero side effects. Side effects would include (but not limited to):
So reducers should never mutate the state that comes in, but return a copy with modifications only made to the copy, if that. Immutable values (like strings, numbers, undefined, etc) can be returned as-is, and so can state, if it hasn't been modified. If you need to make any changes to any inputs, however, you'd return a new copy or a new value.
With regard to the logic being called from your reducer, as long as all that code meets these requirements, then you are in-line with the Redux pattern.
Unfortunately, JavaScript doesn't have a way to know for sure when any given code has side effects (other languages do), so you should just be aware of what you are calling.
Will it break Redux if you fail? No. But things might not work exactly as you (or the Flux/Redux developers) expect.