export function $set<T>(state: T, exec: (state: T) => void): T { state = _.cloneDeep(state); exec(state); return state; }