We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
current()
The typings of current() state that the input and return types are the same. This doesn't reflect that the function unwraps drafts.
const draft = immer.createDraft({ a: true }); immer.current(draft);
Observe typings of the returned object. Runtime object is not a draft, but typings indicate that it is.
Return type is the same as the input type.
export declare function current<T>(value: T): T;
Return type is the type of thing whose draft was input.
export declare function current<T>(value: Draft<T>): T;
We only accept bug reports against the latest Immer version.
setUseProxies(true)
setUseProxies(false)
The text was updated successfully, but these errors were encountered:
Same issue with original()
original()
Sorry, something went wrong.
Bumping this. Took a crack at it to no avail.
No branches or pull requests
🐛 Bug Report
The typings of
current()
state that the input and return types are the same. This doesn't reflect that the function unwraps drafts.Link to repro
To Reproduce
Observe typings of the returned object. Runtime object is not a draft, but typings indicate that it is.
Observed behavior
Return type is the same as the input type.
export declare function current<T>(value: T): T;
Expected behavior
Return type is the type of thing whose draft was input.
export declare function current<T>(value: Draft<T>): T;
Environment
We only accept bug reports against the latest Immer version.
setUseProxies(true)
setUseProxies(false)
(ES5 only)The text was updated successfully, but these errors were encountered: