Remove support for `this = draft` in recipes
mweststrate opened this issue · 2 comments
mweststrate commented
Currently, this
is always equal to the draft inside recipes. I suggest to remove that. It has a few benefits:
- simpler typings
- simpler docs
- I didn't see anyone use it
- it makes pattern like this possible (note that we should make sure that the curried version does preserve
this
):
const context = {
foo: 1,
bar: produce(function(draft) {
draft.foo = this.foo
})
}
scriby commented
+1 to this
mweststrate commented
Done in the immer3
branch.