-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Did not find any information about this usecase in the docs
Is there any way to do something like this:
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?
const base = { a: 1 };
const add_b_key = create({...base, b: 1}, (draft) => {
draft.a = 2;
});Or I'm missing an utility/setting
Metadata
Metadata
Assignees
Labels
No labels