effector-vue
Advanced tools
Changelog
effector-vue 23.1.0
Big thanks to egoson for making this release possible
Changelog
effector 23.0.0 Spacewatch
EventCallable
, StoreWritable
and UnitTargetable
types to allow users to express and understand what could be updated or called directly and what could not. Now createStore
returns StoreWritable
which can be passed to sample target and combine
returns Store
which will show type and runtime error (PR #966)addLoc: true
in babel-plugin. Usually the one wanted to enable this in development only so addLoc
plugin option is disabled by default (PR #1015)batch
option to createWatch
(PR #850)@withease/factories
to babel-plugin defaults (PR #995)patronum
modules to babel-plugin defaults (PR #996)greedy
to batch
in sample
. greedy: true
becomes batch: false
which is a better mental model for what this option do (PR #972)merge
and restore
(PR #969)domain
to be used in attach
without parent effect (PR #895).reinit
, now it exists in StoreWritable
and not exists in Store
(PR #966)combine
calls (PR #916)attach
(PR #1011)skipVoid: true
option in combine
and map
to enable old behavior. Getting rid of that edge case will allow to introduce lazy computations (issue #920)forward
and guard
in favor of sample
(PR #913)reactSsr
option in babel-plugin (PR #910)onlyChanges
option in serialize
(PR #907){[fx.sid]: Function}
in fork handlers
(PR #973).watch
with second argument in favor of sample
(PR #906).getType()
- relic from ancient times which exists for redux compatibility (PR #899)effector/babel-plugin-react
(PR #948)fork(domain)
and hydrate(domain)
- this api existed for traking units in scopes when Fork API was introduced, but starting from 22 version this is done automatically and domain is no longer required for that (PR #950)fn
in $store.map(fn)
returns undefined
in the initialization (issue #828)effector/fork
module (PR #842)createStoreObject
alias for combine
(PR #908).thru
method (PR #843)$store.map
(PR #846)restore($store)
support. This was an obscure feature when store is passed to method and returned without changes as is (PR #1018)Changelog
effector-vue 22.2.0
useStoreMap
hook for Vue 3 composition API to select part from a store ((PR #780)[https://github.com/effector/effector/pull/780]) by @ilajosmanovChangelog
effector 22.1.1
.on
and .reset
methodsChangelog
effector-react 22.1.0
useUnit
method to read multiple stores and bind events or effects to scope in a single batched call (PR #733, #738)import {value createEvent, value createStore, value fork} from 'effector'
import {value useUnit, value Provider} from 'effector-react/scope'
const inc = createEvent()
const $count = createStore(0)
const $title = createStore('useStore example')
$count.on(inc, x => x + 1)
const App = () => {
const [count, title, incFn] = useUnit([$count, $title, inc])
return (
<>
<h1>{title}</h1>
<p>Count: {count}</p>
<button onClick={() => incFn()}>increment</button>
</>
)
}
const scope = fork()
render(
() => (
<Provider value={scope}>
<App />
</Provider>
),
document.getElementById('root'),
)
placeholder
option to useList
to render in cases of empty listconst ChatList = () => (
<div>
{useList($chats, {
fn: chat => <div>Chat {chat.name}</div>,
keys: [],
placeholder: <div>You have no chats yet. Add first one?</div>,
})}
</div>
)
defaultValue
option to useStoreMap
to return in cases when fn
returns undefinedconst ChatName = ({id}) => {
const chat = useStoreMap({
store: $chats,
keys: [id],
fn: chats => chats.find(chat => chat.id === id),
defaultValue: {id: 'default', name: 'Default chat'},
})
return <span>{chat.name}</span>
}
Gate.status
store being serialized (PR #683)