Closed sergeysova closed 1 year ago
https://effector.dev/docs/ecosystem-development/unit-shape-protocol
Looks like it would be very useful to use this protocol with useUnit:
useUnit
const formFactory = modelFactory((options: FactoryOptions) => { const loginChanged = createEvent<string>(); const passwordChanged = createEvent<string>(); const submitPressed = createEvent(); const $login = createStore(''); const $password = createStore(''); const $form = combine({ login: $login, password: $password }); const $disabled = options.registerFx.pending; $login.on(loginChanged, (prev, next) => next); $password.on(passwordChanged, (prev, next) => next); sample({ source: $form, clock: submitPressed, target: options.registerFx, }); return { $login, $password, $disabled, loginChanged, passwordChanged, submitPressed, }; }); const form = formFactory({ registerFx }) function App() { const { login, password, disabled, loginChanged, passwordChanged, submitPressed } = useUnit(form) }
But I think it will be very useful to remove $ from the prefix.
$
https://effector.dev/docs/ecosystem-development/unit-shape-protocol
Looks like it would be very useful to use this protocol with
useUnit
:But I think it will be very useful to remove
$
from the prefix.