This repository was archived by the owner on Aug 2, 2025. It is now read-only.

Description
import { createModel } from '@rematch/core'
import { delay } from './utils'
import type { RootModel } from '.'
export const dolphins = createModel<RootModel>()({
state: 0,
reducers: {
increment: (state, payload = 1) => state + payload,
}
})
Describe the bug
Actually the payload = 1 is infered as any and when dispatching the reducer says that: (property) increment: () => Action<void, void>, doesn't expect a payload...
The same occurs if the payload it's optional