Published by AlexandrHoroshih over 1 year ago
fork({ values, handlers })
, which allows to run tests without effector/babel-plugin
. Note, that plugin and sids are still required for SSR. (PR #855)Published by AlexandrHoroshih over 1 year ago
Declaration
type, provide missing top-level properties for region
and factory
typesid
to Declaration
typePublished by igorkamyshev over 1 year ago
withRegion
Published by AlexandrHoroshih over 1 year ago
exports
definition for effector/inspect
APIPublished by AlexandrHoroshih over 1 year ago
Published by sergeysova over 1 year ago
serialize: ignore
on createStore
must not serialize, event fork({ values })
is used for the store (PR #862)Published by zerobias over 1 year ago
Published by zerobias over 1 year ago
Published by zerobias almost 2 years ago
allSettled(scope)
feature.Published by igorkamyshev almost 2 years ago
@@unitShape
protocol (PR #803) in useUnit
Published by igorkamyshev almost 2 years ago
@@unitShape
protocol (PR #803) in useUnit
Published by zerobias almost 2 years ago
source
. This case now supported and typechecked correctly:const profileFormSubmitted = createEvent()
const $name = createStore('alice')
const $age = createStore(0)
const saveProfileFx = createEffect(async ([name, age]: [string, number]) => {})
sample({
clock: profileFormSubmitted,
source: [$name, $age] as const,
target: saveProfileFx,
})
Note that the one need to use "as const" in that case to got correct typechecking because without it typescript cannot infer the type [Store<string>, Store<number>]
. We are working to avoid that limitation, stay tuned!
Published by zerobias almost 2 years ago
$store.reinit
event to reset store to default value (PR #797)Before $store.reinit
:
const $formValues = createStore<FormValues | null>(null);
sample({
clock: [timeoutOut, buttonClicked, meteorHit],
target: [
saveAllStuffFx,
]
})
// here we would need to duplicate the same clocks 👎
$formValues.reset([timeoutOut, buttonClicked, meteorHit])
With $store.reinit
:
const $formValues = createStore<FormValues | null>(null);
sample({
clock: [timeoutOut, buttonClicked, meteorHit],
target: [
saveAllStuffFx,
// reset $formValues back to null due to one of the clock reasons
$formValues.reinit,
// no need to duplicate clocks list 👍
]
})
is.attached
method to detect effects created via attach
(PR #670)Gate
to be serialized (as this requires changes in babel plugin) (PR #683)Published by zerobias almost 2 years ago
useUnit
skipping updates when used with useEffect
and useGate
Published by zerobias about 2 years ago
useUnit
skipping updates during scope changes (often happens in next.js apps). Big thanks to @AlexandrHoroshih for investigationPublished by zerobias about 2 years ago
useUnit
skipping updates in react 16-17Published by igorkamyshev about 2 years ago
useStoreMap
hook for Vue 3 composition API to select part from a store (PR #780 by @ilajosmanov)Published by igorkamyshev about 2 years ago
useEvent
, useStore
, useStoreMap
and useList
isomorphic, now they would use scope
from the Provider
if it is available and scope-less mode otherwise. For useUnit
it was done in 22.2.0.forceScope
to useEvent
, useStore
, useStoreMap
and useList
to force usage of scope from Provider
, it would throw an error if Provider
is not available, /scope
module sets forceScope
to true
by defaultPublished by igorkamyshev about 2 years ago
Provider
to main module