-
-
Save mfrancois3k/707cf52e6cd5b43ad8dc17acbd6300ae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const NameField = createField({ | |
view: ({ value, onChange }) => <Input value={value} onChange={onChange} /> | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { saveUser } from '~api' | |
import { NameField } from './0.NameField.ts' | |
import { SaveButton } from './1.SaveButton.ts' | |
const $form = createStoreObject({ | |
name: NameField.$value | |
}) | |
forward({ | |
from: sample($form, SaveButton.pressed), | |
to: saveUser | |
}) | |
const Form = () => { | |
return <form onSubmit={SaveButton.pressed}> | |
<NameField /> | |
<SaveButton /> | |
</form> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment