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

feat: export isDraft function #220

Merged
merged 5 commits into from Oct 25, 2018
Merged

Conversation

aleclarson
Copy link
Member

To use in other libraries

@coveralls
Copy link

Coverage Status

Coverage remained the same at 93.28% when pulling 13263c0 on aleclarson:isDraft into 09d69ae on mweststrate:master.

@aleclarson
Copy link
Member Author

I guess you could do !!original(value) to get the same effect as isDraft(value). WDYT?

@immerjs immerjs deleted a comment from coveralls Oct 19, 2018
@immerjs immerjs deleted a comment from coveralls Oct 19, 2018
@mweststrate
Copy link
Collaborator

mweststrate commented Oct 20, 2018 via email

@aleclarson
Copy link
Member Author

@mweststrate "Just proxies" is the idea. LGTM?

@mweststrate
Copy link
Collaborator

@aleclarson LGTM. Could you add some tests for both proxy and non proxied version?

@aleclarson
Copy link
Member Author

Are tests necessary? It's a very simple function: const isDraft = (value) => !!value && !!value[PROXY_STATE]

@mweststrate
Copy link
Collaborator

mweststrate commented Oct 21, 2018 via email

@aleclarson
Copy link
Member Author

Done!

@aleclarson aleclarson force-pushed the isDraft branch 2 times, most recently from 75d6f82 to f2b3e4b Compare October 21, 2018 15:18
Copy link
Collaborator

@mweststrate mweststrate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@aleclarson aleclarson merged commit 843fe76 into immerjs:master Oct 25, 2018
aleclarson added a commit that referenced this pull request Oct 28, 2018
aleclarson added a commit that referenced this pull request Oct 28, 2018
migueloller pushed a commit to migueloller/immer that referenced this pull request Nov 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants