From 2f649a6f3e0f0dd22cf6887106c6ddc62554c40f Mon Sep 17 00:00:00 2001 From: Vladyslav Zubko <42296182+what1s1ove@users.noreply.github.com> Date: Sun, 3 Dec 2023 18:12:03 +0200 Subject: [PATCH] style: use spaces for md files fp-50 (#51) --- .editorconfig | 2 +- readme.md | 152 +++++++++++++++++++++++++------------------------- 2 files changed, 77 insertions(+), 77 deletions(-) diff --git a/.editorconfig b/.editorconfig index a9ee77e..807205c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,6 +8,6 @@ trim_trailing_whitespace = true insert_final_newline = true charset = utf-8 -[*.yml] +[*.{yml,md}] indent_style = space indent_size = 2 diff --git a/readme.md b/readme.md index 79d3806..805ec46 100644 --- a/readme.md +++ b/readme.md @@ -17,35 +17,35 @@ npm install form-payload ```html
- - - -
- Friend - -
- + + + +
+ Friend + +
+
...
- +
``` @@ -56,22 +56,22 @@ import { getFormValues, getControlValue } from 'form-payload'; const { general: generalFormNode, mailing: mailingFormNode } = document.forms; generalFormNode.addEventListener('submit', (evt) => { - evt.preventDefault(); - - console.log(getFormValues(generalFormNode)); - // { - // name: 'Jon', - // birthday: Sat Mar 27 2021 18:06:42 GMT+0200 (Eastern European Standard Time), - // friendsCount: 1, - // friend: { - // friendName: 'Kate', - // }, - // } + evt.preventDefault(); + + console.log(getFormValues(generalFormNode)); + // { + // name: 'Jon', + // birthday: Sat Mar 27 2021 18:06:42 GMT+0200 (Eastern European Standard Time), + // friendsCount: 1, + // friend: { + // friendName: 'Kate', + // }, + // } }); mailingFormNode.addEventListener('change', (evt) => { - console.log(getControlValue(evt.target)); - // 'example@mail.com' + console.log(getControlValue(evt.target)); + // 'example@mail.com' }); ``` @@ -85,45 +85,45 @@ _It doesn't matter which framework you use, you just need to pass the valid [HTM import { getFormValues, getControlValue, ControlType } from 'form-payload'; const SimpleForm = () => { -const handleSubmit = (evt: React.FormEvent) => { - evt.preventDefault(); - - console.log(getFormValues(evt.target as HTMLFormElement)); - // { - // name: 'Jon', - // birthday: Sat Mar 27 2021 18:06:42 GMT+0200 (Eastern European Standard Time), - // } -}; - -const handleChange = (evt: React.ChangeEvent) => { - console.log(getControlValue(evt.target)); - // 'example@mail.com' -}; - -return ( - <> -
- - - -
- - ... - -
- -
- -); + const handleSubmit = (evt: React.FormEvent) => { + evt.preventDefault(); + + console.log(getFormValues(evt.target as HTMLFormElement)); + // { + // name: 'Jon', + // birthday: Sat Mar 27 2021 18:06:42 GMT+0200 (Eastern European Standard Time), + // } + }; + + const handleChange = (evt: React.ChangeEvent) => { + console.log(getControlValue(evt.target)); + // 'example@mail.com' + }; + + return ( + <> +
+ + + +
+ + ... + +
+ +
+ + ); }; ```