You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set object are very useful in situations where uniqueness is required. In my opinion it is cleaner to use Set instead object literals with values set to true
varstate={items: newSet()}varmutations={newItem(state,item){// state.items = { ...state.items, item: true } // -- works but it is kinda hack// state.items = new Set([...state.items, item]) // -- this works correctly but is messystate.items.add(item)// -- it seems to not observe changes through add method.}}
What problem does this feature solve?
Set object are very useful in situations where uniqueness is required. In my opinion it is cleaner to use Set instead object literals with values set to
true
Link to sandbox with this example https://codesandbox.io/s/03w04xjq4p
What does the proposed API look like?
No extra API is needed. Observe changes through native Set methods
add
anddelete
The text was updated successfully, but these errors were encountered: