NE
Size: a a a
NE
🅅🄺
🅅🄺
🅅🄺
NE
NE
🅅🄺
🅅🄺
🅅🄺
🅅🄺
🅅🄺
🅅🄺
🚀🚀
NE
const domainA = createDomain(‘formTypeA’)
const formTypeA = createForm(config)
const domainB = createDomain(‘formTypeB’)
const formTypeB = createForm(config)
const typeToModel = {
typeA: domainA,
typeB: domainA,
}
const create = createEvent()
const choose = createEvent<{id: string, type: typeA | typeB}>()
const clearFx = createEffect((scope: Maybe<Scope>) => fold(scope, noop, clearNode))
const forms = createStore<Map</*id*/string, Maybe<Scope>>>(Map())
.on(create, map => map.set(uuid(), None))
.on(choose, (map, {id, type}) => map.set(id, fork(typeToModel[type])))
sample({
source: forms,
clock: choose,
fn => ($forms, {id}) => $forms.get(id, None),
target: clearFx,
})
🚀🚀
const domainA = createDomain(‘formTypeA’)
const formTypeA = createForm(config)
const domainB = createDomain(‘formTypeB’)
const formTypeB = createForm(config)
const typeToModel = {
typeA: domainA,
typeB: domainA,
}
const create = createEvent()
const choose = createEvent<{id: string, type: typeA | typeB}>()
const clearFx = createEffect((scope: Maybe<Scope>) => fold(scope, noop, clearNode))
const forms = createStore<Map</*id*/string, Maybe<Scope>>>(Map())
.on(create, map => map.set(uuid(), None))
.on(choose, (map, {id, type}) => map.set(id, fork(typeToModel[type])))
sample({
source: forms,
clock: choose,
fn => ($forms, {id}) => $forms.get(id, None),
target: clearFx,
})
🚀🚀
NE
NE
🅅🄺
🅅🄺