const problem = {
  state(){
    return {
      cart: []
    };
  },
  mutations: {
    addProblem: (state, problem) =>
      (state.cart = [
        ...state.cart.filter((item) => item.id !== problem.id),
        problem
      ]),
    removeProblem: (state, problem) =>
      (state.cart = state.cart.filter((item) => item.id !== problem.id)),
    clearProblem: (state) => (state.cart = []),
  }
};
export default problem;
