-
Add
onlyChanges
option toserialize
to ignore stores which didn't changed in fork (prevent default values from being carried over network) -
Add type helpers for stores and effects:
StoreValue
,EffectParams
,EffectResult
andEffectError
import {
createStore,
createEffect,
StoreValue,
EffectParams,
EffectResult,
} from 'effector'
const username = createStore('guest')
const getUserFX = createEffect<number, {name: string}>()
// string
type Username = StoreValue<typeof username>
// number
type GetUserParams = EffectParams<typeof getUserFX>
// {name: string}
type User = EffectResult<typeof getUserFX>
- Allow
domain.createEffect
to infer type from givenhandler
(that feature was already implemented forcreateEffect
method), this code now typechecked as expected:
import {createDomain} from 'effector'
const app = createDomain()
const voidFx = app.createEffect({
async handler() {},
})
await voidFx()
- Allow to call
allSettled
with void units withoutparams
field, this code now typechecked as expected:
import {createDomain, fork, allSettled} from 'effector'
const app = createDomain()
const voidFx = app.createEffect({
async handler() {},
})
voidFx()
const scope = fork(app)
await allSettled(voidFx, {scope})