🚀🚀
Size: a a a
🚀🚀
DS
const teamUpdated = sample({
source: $teams,
clock: editEmployeeTeam,
fn: (teams, teamId) => teams.find((team) => teamId === team.id),
})
export const $employee = restore<Employee>(fetchEmployeeFx.doneData, null)
.reset(InitGate.close)
.on(teamUpdated, (store, team) => ({ ...store, team }))
🚀🚀
NT
🦜
DT
🦜
🦜
🚀🚀
DT
🚀🚀
import {domain} from 'effector-next'
const states = window.__DEV__STATES__ = window.__DEV__STATES__ || {}
domain.onCreateStore(store => {
if (!store.sid) return
if (store.sid in states) {
const {defaultState, actual} = states[store.sid]
if (store.defaultState === defaultState) {
store.setState(actual)
} else {
states[store.sid] = {
defaultState: store.defaultState,
actual: store.getState(),
}
}
} else {
states[store.sid] = {
defaultState: store.defaultState,
actual: store.getState(),
}
}
store.updates.watch(value => {
states[store.sid].actual = value
})
})
🚀🚀
🚀🚀
DT
DT
🚀🚀
ф
import {domain} from 'effector-next'
const states = window.__DEV__STATES__ = window.__DEV__STATES__ || {}
domain.onCreateStore(store => {
if (!store.sid) return
if (store.sid in states) {
const {defaultState, actual} = states[store.sid]
if (store.defaultState === defaultState) {
store.setState(actual)
} else {
states[store.sid] = {
defaultState: store.defaultState,
actual: store.getState(),
}
}
} else {
states[store.sid] = {
defaultState: store.defaultState,
actual: store.getState(),
}
}
store.updates.watch(value => {
states[store.sid].actual = value
})
})
__DEV__STATES__
откуда?🚀🚀
OR
const states = window.__DEV__STATES__ = window.__DEV__STATES__
🤔🚀🚀
const states = window.__DEV__STATES__ = window.__DEV__STATES__
🤔|| {}
забыл