How to add new keys?
Did not find any information about this usecase in the docs
Is there any way to do something like this:
```ts
const base = { a: 1 };
const add_b_key = create(base, (draft) => {
draft.a = 2;
draft.b = 1;
});
```
getting error on `b`: `Property 'b' does not exist on type 'DraftedObject<{ a: number; }>'.`
**Would love to use mutative notation for both new and existing keys.**
Are we expected to spread operate the base for new keys?
```ts
const base = { a: 1 };
const add_b_key = create({...base, b: 1}, (draft) => {
draft.a = 2;
});
```
0 条评论