UNPKG

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