Is there any reason you’d want to do this?
`void 0` ensures that you get the `undefined` value regardless of any shadowing that may be happening with the `undefined` binding.
If you don't want the result, just call
someFunction()
instead of
const a = void someFunction()
import { produce } from 'immer'
let i = 1
const a = produce({ x: 0 }, draftState => i++)
const b = produce({ x: 0 }, draftState => void i++)
const c = produce({ x: 0 }, draftState => {
i++
})
console.log({ a, b, c }) // Logs: { a: 1, b: { x: 0 }, c: { x: 0 } }
The immer docs have a section about this pattern: https://immerjs.github.io/immer/return#inline-shortcuts-usin...