Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for `this = draft` in recipes #308

Closed
mweststrate opened this issue Feb 2, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@mweststrate
Copy link
Collaborator

commented Feb 2, 2019

Currently, this is always equal to the draft inside recipes. I suggest to remove that. It has a few benefits:

  1. simpler typings
  2. simpler docs
  3. I didn't see anyone use it
  4. 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
  })
}

@mweststrate mweststrate referenced this issue Feb 3, 2019

Merged

immer 3.0 #309

3 of 5 tasks complete

mweststrate added a commit that referenced this issue Feb 3, 2019

docs: removed deprecation note on this, see #308
docs: add example of an `immerable` class
@scriby

This comment has been minimized.

Copy link
Contributor

commented Feb 3, 2019

+1 to this

@mweststrate

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 15, 2019

Done in the immer3 branch.

mweststrate added a commit that referenced this issue Apr 15, 2019

docs: removed deprecation note on this, see #308
docs: add example of an `immerable` class

mweststrate added a commit that referenced this issue Apr 15, 2019

docs: removed deprecation note on this, see #308
docs: add example of an `immerable` class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.