Skip to content

docs: explain the default state of curried producers - #1373

Open
Hugohong258 wants to merge 1 commit into
immerjs:mainfrom
Hugohong258:docs-curried-produce-initial-state
Open

Hugohong258 wants to merge 1 commit into
immerjs:mainfrom
Hugohong258:docs-curried-produce-initial-state

Conversation

@Hugohong258

Copy link
Copy Markdown
Contributor

The TypeScript guide shows a curried producer with an initial state and labels its state argument as required. This example now shows that the argument is optional and demonstrates calling the producer without one. It also explains why a default on the recipe parameter does not provide a default draft, the distinction discussed in #1003.

Compiled the updated example under strict TypeScript settings and checked omitted, explicit undefined, and supplied state at runtime. The source suite passed (4,213 passed, 8 skipped).

Prepared with AI assistance.

This branch has not been deployed

No deployments
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.

1 participant