1 | # 🌹 @sharyn/client
|
2 |
|
3 | [![npm](https://img.shields.io/npm/v/@sharyn/client.svg)](https://www.npmjs.com/package/@sharyn/client)
|
4 |
|
5 | This package provides client-side helpers.
|
6 |
|
7 | ## 🌹 Install
|
8 |
|
9 | ```bash
|
10 | yarn add @sharyn/client
|
11 | ```
|
12 |
|
13 | ## 🌹 Usage
|
14 |
|
15 | ### getFormData
|
16 |
|
17 | ```js
|
18 | import { getFormData } from '@sharyn/client/form'
|
19 |
|
20 | const handleSubmit = e => {
|
21 | console.log(getFormData(e.target))
|
22 | }
|
23 |
|
24 | const Form = () => (
|
25 | <form onSubmit={handleSubmit}>
|
26 | <input name="foo" />
|
27 | <input type="submit" />
|
28 | </form>
|
29 | )
|
30 |
|
31 | /*
|
32 | onSubmit:
|
33 | { foo: [value] }
|
34 | */
|
35 |
|
36 | ```
|