Open nionis opened 6 years ago
State is not updated in the DB
There is unexpected behaviour when a key in state contains "/", due to the way JSON patches work "/" determines the path in a JSON patch.
Example:
// reducer function updateState = (id, value) => { console.log(id) // "eth/usd" (contains "/") state[id].value = value // state will not update }
Don't use "/" in a key
We should add developer warning, sort of how react does
const warn = (msg) => process.env.NODE_ENV !== 'production' && debug(msg)
and then warn about things like this; good catch.
Issue:
State is not updated in the DB
Why:
There is unexpected behaviour when a key in state contains "/", due to the way JSON patches work "/" determines the path in a JSON patch.
Example:
Solution:
Don't use "/" in a key