Answer the question
In order to leave comments, you need to log in
How to remove a key in an object from LocalStorage?
There is a caretaker
{3: {}, 4: {}, 5: {}}
3: {}
4: {}
5: {}
LocalStorage.setItem(TEMPORARY_STATE, Object.assign(blocks, { ...state.tmp, [block.id]: {} }))
Answer the question
In order to leave comments, you need to log in
Unfortunately, removing a key from an object using destructuring looks like a terrible ugly no matter how hard you try. I advise you to create a helper function `omit(keys, object)` like omit from the lodash or ramda libraries. https://github.com/ramda/ramda/blob/master/source/...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question