From ac285cbf013e18b749510713fc69a193c7dc579d Mon Sep 17 00:00:00 2001 From: Roland Szoke Date: Fri, 21 Feb 2020 15:03:02 +0100 Subject: [PATCH 1/7] docs(contributing): add documaentation for contributing --- CONTRIBUTING.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..1cf0a7f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,33 @@ +# Contributing + +## Issues + +Issues are precious to this project. + +- **Ideas** are a valuable source of contributions others can make +- **Problems** show where this project is lacking +- With a **question**, you show where contributors can improve the user experience + +Thank you for creating them. + +## Commits + +Your commit messages should follow Angular [commit convention](https://www.conventionalcommits.org/en/v1.0.0-beta.4/). Therefore we are linting your commits with [Husky](https://github.com/typicode/husky), meaning you cannot create a non-conventional commit message. If you squash merge your pull request, please make sure you also follow the commit convention in your squashed commit message. + +## Pull Requests + +Pull requests are a great way to get your ideas into this repository. +You should be clear which problem you're trying to solve with your contribution. +Every pull request will require an approved review before merging. + +## Linters + +This project is using [ESLint](https://eslint.org/) for linting and [Prettier](https://prettier.io/) for code formatting. Please follow their standards on contributing. Your code is automatically formatted on saving a file when using [VSCode](https://code.visualstudio.com/) or [Atom](https://atom.io/). [Husky](https://github.com/typicode/husky) ensures that your changes are properly linted before making a commit. If you want to lint manually, you can use `lint` and `lint-fix` npm scripts to lint the source code and `lint-tests` and `lint-tests-fix` to lint the test files. + +## Tests + +To run tests use `npm t` script. We are using [Jest](https://jestjs.io/) and [React Testing Library](https://github.com/testing-library/react-testing-library) for testing. Consider creating new test cases when necessary under the `__tests__` folder, we want to keep our test covarage above 90%. Use `.test.js` or `.test.jsx` suffix for test files and `.test.native.js` or `.test.native.jsx` for native tests. + +## Build process + +TODO From 7865839e2afa169ca3c1141817175e7231d05220 Mon Sep 17 00:00:00 2001 From: Roland Szoke Date: Fri, 21 Feb 2020 15:09:19 +0100 Subject: [PATCH 2/7] docs(contributing): wording change for linters segment --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1cf0a7f..e19549a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,11 +22,11 @@ Every pull request will require an approved review before merging. ## Linters -This project is using [ESLint](https://eslint.org/) for linting and [Prettier](https://prettier.io/) for code formatting. Please follow their standards on contributing. Your code is automatically formatted on saving a file when using [VSCode](https://code.visualstudio.com/) or [Atom](https://atom.io/). [Husky](https://github.com/typicode/husky) ensures that your changes are properly linted before making a commit. If you want to lint manually, you can use `lint` and `lint-fix` npm scripts to lint the source code and `lint-tests` and `lint-tests-fix` to lint the test files. +This project is using [ESLint](https://eslint.org/) for linting and [Prettier](https://prettier.io/) for code formatting. Please follow their standards on contributing. Your code is automatically formatted on saving a file when using [VSCode](https://code.visualstudio.com/) or [Atom](https://atom.io/). [Husky](https://github.com/typicode/husky) ensures that your changes are properly linted before making a commit. If you want to lint manually, you can use `lint` and `lint-fix` npm scripts to lint the source code and `lint-tests` or `lint-tests-fix` to lint the test files. ## Tests -To run tests use `npm t` script. We are using [Jest](https://jestjs.io/) and [React Testing Library](https://github.com/testing-library/react-testing-library) for testing. Consider creating new test cases when necessary under the `__tests__` folder, we want to keep our test covarage above 90%. Use `.test.js` or `.test.jsx` suffix for test files and `.test.native.js` or `.test.native.jsx` for native tests. +To run our tests use `npm t` script. We are using [Jest](https://jestjs.io/) and [React Testing Library](https://github.com/testing-library/react-testing-library) for testing. Consider creating new test cases when necessary under the `__tests__` folder, we want to keep our test covarage above 90%. Use `.test.js` or `.test.jsx` suffix for test files and `.test.native.js` or `.test.native.jsx` for native tests. ## Build process From a9f94d84776f2e6b1af36f42dd39680964f73fa8 Mon Sep 17 00:00:00 2001 From: Roland Szoke Date: Fri, 21 Feb 2020 15:29:53 +0100 Subject: [PATCH 3/7] docs(readme): link to contributing doc, lint readme --- README.md | 291 +++++++++++++++++++++++++++++------------------------- 1 file changed, 156 insertions(+), 135 deletions(-) diff --git a/README.md b/README.md index 08ff201..d776d94 100644 --- a/README.md +++ b/README.md @@ -14,18 +14,23 @@ Simple React state management. Made with :heart: and ES6 Proxies. -- [Introduction](#introduction) -- [Installation](#installation) -- [Usage](#usage) - - [Creating global stores](#creating-global-stores) - - [Creating reactive views](#creating-reactive-views) - - [Creating local stores](#creating-local-stores) -- [Examples with live demos](#examples-with-live-demos) -- [Articles](#articles) -- [Performance](#performance) -- [Platform support](#platform-support) -- [Alternative builds](#alternative-builds) -- [Contributing](#contributing) +- [React Easy State](#react-easy-state) + - [Introduction](#introduction) + - [Installation](#installation) + - [Usage](#usage) + - [Creating global stores](#creating-global-stores) + - [Creating reactive views](#creating-reactive-views) + - [Creating local stores](#creating-local-stores) + - [Local stores in function components](#local-stores-in-function-components) + - [Local stores in class components](#local-stores-in-class-components) + - [Examples with live demos](#examples-with-live-demos) + - [Beginner](#beginner) + - [Advanced](#advanced) + - [Articles](#articles) + - [Performance](#performance) + - [Platform support](#platform-support) + - [Alternative builds](#alternative-builds) + - [Contributing](#contributing) @@ -39,13 +44,15 @@ React Easy State is a practical state management library with two functions and 2. Always wrap your state store objects with `store()`. ```jsx -import React from 'react' -import { store, view } from 'react-easy-state' +import React from 'react'; +import { store, view } from 'react-easy-state'; -const counter = store({ num: 0 }) -const increment = () => counter.num++ +const counter = store({ num: 0 }); +const increment = () => counter.num++; -export default view(() => ) +export default view(() => ( + +)); ``` This is enough for it to automatically update your views when needed. It doesn't matter how you structure or mutate your state stores, any syntactically valid code works. @@ -80,11 +87,11 @@ _You need npm 5.2+ to use npx._ `store` creates a state store from the passed object and returns it. A state store behaves just like the passed object. (To be precise, it is a transparent reactive proxy of the original object.) ```js -import { store } from 'react-easy-state' +import { store } from 'react-easy-state'; -const user = store({ name: 'Rick' }) +const user = store({ name: 'Rick' }); // stores behave like normal JS objects -user.name = 'Bob' +user.name = 'Bob'; ```
@@ -92,7 +99,7 @@ user.name = 'Bob'

```js -import { store } from 'react-easy-state' +import { store } from 'react-easy-state'; // stores can include any valid JS structure // including nested data, arrays, Maps, Sets, getters, setters, inheritance, ... @@ -101,18 +108,18 @@ const user = store({ firstName: 'Bob', lastName: 'Smith', get name() { - return `${user.firstName} ${user.lastName}` - } + return `${user.firstName} ${user.lastName}`; + }, }, hobbies: ['programming', 'sports'], - friends: new Map() -}) + friends: new Map(), +}); // stores may be mutated in any syntactically valid way -user.profile.firstName = 'Bob' -delete user.profile.lastName -user.hobbies.push('reading') -user.friends.set('id', otherUser) +user.profile.firstName = 'Bob'; +delete user.profile.lastName; +user.hobbies.push('reading'); +user.friends.set('id', otherUser); ```
@@ -123,16 +130,16 @@ user.friends.set('id', otherUser)

```js -import { store } from 'react-easy-state' +import { store } from 'react-easy-state'; const userStore = store({ user: {}, async fetchUser() { - userStore.user = await fetch('/user') - } -}) + userStore.user = await fetch('/user'); + }, +}); -export default userStore +export default userStore; ``` @@ -145,32 +152,34 @@ export default userStore _userStore.js_ ```js -import { store } from 'react-easy-state' +import { store } from 'react-easy-state'; const userStore = store({ user: {}, async fetchUser() { - userStore.user = await fetch('/user') - } -}) + userStore.user = await fetch('/user'); + }, +}); -export default userStore +export default userStore; ``` _recipesStore.js_ ```js -import { store } from 'react-easy-state' -import userStore from './userStore' +import { store } from 'react-easy-state'; +import userStore from './userStore'; const recipesStore = store({ recipes: [], async fetchRecipes() { - recipesStore.recipes = await fetch(`/recipes?user=${userStore.user.id}`) - } -}) + recipesStore.recipes = await fetch( + `/recipes?user=${userStore.user.id}`, + ); + }, +}); -export default recipesStore +export default recipesStore; ``` @@ -182,18 +191,18 @@ export default recipesStore ```js // DON'T DO THIS -const person = { name: 'Bob' } -person.name = 'Ann' +const person = { name: 'Bob' }; +person.name = 'Ann'; -export default store(person) +export default store(person); ``` ```js // DO THIS INSTEAD -const person = store({ name: 'Bob' }) -person.name = 'Ann' +const person = store({ name: 'Bob' }); +person.name = 'Ann'; -export default person +export default person; ``` The first example wouldn't trigger re-renders on the `person.name = 'Ann'` mutation, because it is targeted at the raw object. Mutating the raw - none `store`-wrapped object - won't schedule renders. @@ -206,19 +215,21 @@ The first example wouldn't trigger re-renders on the `person.name = 'Ann'` mutat

```jsx -import { store, view } from 'react-easy-state' +import { store, view } from 'react-easy-state'; const counter = store({ num: 0, increment() { // DON'T DO THIS - this.num++ + this.num++; // DO THIS INSTEAD - counter.num++ - } -}) + counter.num++; + }, +}); -export default view(() =>
{counter.num}
) +export default view(() => ( +
{counter.num}
+)); ``` `this.num++` won't work, because `increment` is passed as a callback and loses its `this`. You should use the direct object reference - `counter` - instead of `this`. @@ -230,19 +241,22 @@ export default view(() =>
{counter.num}
) Wrapping your components with `view` turns them into reactive views. A reactive view re-renders whenever a piece of store - used inside its render - changes. ```jsx -import React from 'react' -import { view, store } from 'react-easy-state' +import React from 'react'; +import { view, store } from 'react-easy-state'; // this is a global state store -const user = store({ name: 'Bob' }) +const user = store({ name: 'Bob' }); // this is re-rendered whenever user.name changes export default view(() => (
- (user.name = ev.target.value)} /> + (user.name = ev.target.value)} + />
Hello {user.name}!
-)) +)); ```
@@ -250,25 +264,25 @@ export default view(() => (

```jsx -import { view, store } from 'react-easy-state' +import { view, store } from 'react-easy-state'; const appStore = store({ - user: { name: 'Ann' } -}) + user: { name: 'Ann' }, +}); const App = view(() => (

My App

-)) +)); // DO THIS -const Profile = view(({ user }) =>

Name: {user.name}

) +const Profile = view(({ user }) =>

Name: {user.name}

); // DON'T DO THIS // This won't re-render on appStore.user.name = 'newName' like mutations -const Profile = ({ user }) =>

Name: {user.name}

+const Profile = ({ user }) =>

Name: {user.name}

; ```
@@ -279,11 +293,11 @@ const Profile = ({ user }) =>

Name: {user.name}

```jsx -import React from 'react' -import { view, store } from 'react-easy-state' +import React from 'react'; +import { view, store } from 'react-easy-state'; -const user = store({ name: 'Bob' }) -const timeline = store({ posts: ['react-easy-state'] }) +const user = store({ name: 'Bob' }); +const timeline = store({ posts: ['react-easy-state'] }); // this is re-rendered whenever user.name or timeline.posts[0] changes export default view(() => ( @@ -291,7 +305,7 @@ export default view(() => (
Hello {user.name}!
Your first post is: {timeline.posts[0]}
-)) +)); ``` @@ -313,14 +327,14 @@ export default view(() => (

```jsx -import React from 'react' -import { view, store, batch } from 'react-easy-state' +import React from 'react'; +import { view, store, batch } from 'react-easy-state'; -const user = store({ name: 'Bob', age: 30 }) +const user = store({ name: 'Bob', age: 30 }); function mutateUser() { - user.name = 'Ann' - user.age = 32 + user.name = 'Ann'; + user.age = 32; } // calling `mutateUser` will only trigger a single re-render of the below component @@ -329,31 +343,31 @@ export default view(() => (
name: {user.name}, age: {user.age}
-)) +)); ``` If you mutate your stores multiple times synchronously from **exotic task sources**, multiple renders may rarely happen. If you experience performance issues you can batch changes manually with the `batch` function. `batch(fn)` executes the passed function immediately and batches any subsequent re-renders until the function execution finishes. ```jsx -import React from 'react' -import { view, store, batch } from 'react-easy-state' +import React from 'react'; +import { view, store, batch } from 'react-easy-state'; -const user = store({ name: 'Bob', age: 30 }) +const user = store({ name: 'Bob', age: 30 }); function mutateUser() { // this makes sure the state changes will cause maximum one re-render, // no matter where this function is getting invoked from batch(() => { - user.name = 'Ann' - user.age = 32 - }) + user.name = 'Ann'; + user.age = 32; + }); } export default view(() => (
name: {user.name}, age: {user.age}
-)) +)); ``` > **NOTE:** The React team plans to improve render batching in the future. The `batch` function and built-in batching may be deprecated and removed in the future in favor of React's own batching. @@ -366,19 +380,19 @@ export default view(() => (

```jsx -import { view } from 'react-easy-state' -import { withRouter } from 'react-router-dom' -import { withTheme } from 'styled-components' +import { view } from 'react-easy-state'; +import { withRouter } from 'react-router-dom'; +import { withTheme } from 'styled-components'; -const Comp = () =>
A reactive component
+const Comp = () =>
A reactive component
; // DO THIS -withRouter(view(Comp)) -withTheme(view(Comp)) +withRouter(view(Comp)); +withTheme(view(Comp)); // DON'T DO THIS -view(withRouter(Comp)) -view(withTheme(Comp)) +view(withRouter(Comp)); +view(withTheme(Comp)); ``` @@ -404,21 +418,23 @@ This is not necessary if you use React Router 4.4+. You can find more details an Third party helpers - like data grids - may consist of many internal components which can not be wrapped by `view`, but sometimes you would like them to re-render when the passed data mutates. Traditional React components re-render when their props change by reference, so mutating the passed reactive data won't work in these cases. You can solve this issue by deep cloning the observable data before passing it to the component. This creates a new reference for the consuming component on every store mutation. ```jsx -import React from 'react' -import { view, store } from 'react-easy-state' -import Table from 'rc-table' -import cloneDeep from 'lodash/cloneDeep' +import React from 'react'; +import { view, store } from 'react-easy-state'; +import Table from 'rc-table'; +import cloneDeep from 'lodash/cloneDeep'; const dataStore = store({ items: [ { product: 'Car', - value: 12 - } - ] -}) + value: 12, + }, + ], +}); -export default view(() => ) +export default view(() => ( +
+)); ``` @@ -447,19 +463,22 @@ export default view(() => {

```jsx -import React from 'react' -import { view, store } from 'react-easy-state' +import React from 'react'; +import { view, store } from 'react-easy-state'; export default view(() => { - const [name, setName] = useState('Ann') - const user = store({ age: 30 }) + const [name, setName] = useState('Ann'); + const user = store({ age: 30 }); return (
setName(ev.target.value)} /> - (user.age = ev.target.value)} /> + (user.age = ev.target.value)} + />
- ) -}) + ); +}); ``` @@ -467,19 +486,21 @@ export default view(() => { #### Local stores in class components ```jsx -import React, { Component } from 'react' -import { view, store } from 'react-easy-state' +import React, { Component } from 'react'; +import { view, store } from 'react-easy-state'; class Counter extends Component { - counter = store({ num: 0 }) - increment = () => counter.num++ + counter = store({ num: 0 }); + increment = () => counter.num++; render() { - return + return ( + + ); } } -export default view(Counter) +export default view(Counter); ```
@@ -487,15 +508,15 @@ export default view(Counter)

```jsx -import React, { Component } from 'react' -import { view, store } from 'react-easy-state' +import React, { Component } from 'react'; +import { view, store } from 'react-easy-state'; class Profile extends Component { - state = { name: 'Ann' } - user = store({ age: 30 }) + state = { name: 'Ann' }; + user = store({ age: 30 }); - setName = ev => this.setState({ name: ev.target.value }) - setAge = ev => (this.user.age = ev.target.value) + setName = ev => this.setState({ name: ev.target.value }); + setAge = ev => (this.user.age = ev.target.value); render() { return ( @@ -503,11 +524,11 @@ class Profile extends Component { - ) + ); } } -export default view(Profile) +export default view(Profile); ```
@@ -518,14 +539,14 @@ export default view(Profile)

```jsx -import React, { Component } from 'react' -import { view, store } from 'react-easy-state' +import React, { Component } from 'react'; +import { view, store } from 'react-easy-state'; class Profile extends Component { // DON'T DO THIS - state = store({}) + state = store({}); // DO THIS - user = store({}) + user = store({}); render() {} } ``` @@ -540,22 +561,22 @@ class Profile extends Component { Class components wrapped with `view` have an extra static `deriveStoresFromProps` lifecycle method, which works similarly to the vanilla `getDerivedStateFromProps`. ```jsx -import React, { Component } from 'react' -import { view, store } from 'react-easy-state' +import React, { Component } from 'react'; +import { view, store } from 'react-easy-state'; class NameCard extends Component { - userStore = store({ name: 'Bob' }) + userStore = store({ name: 'Bob' }); static deriveStoresFromProps(props, userStore) { - userStore.name = props.name || userStore.name + userStore.name = props.name || userStore.name; } render() { - return
{this.userStore.name}
+ return
{this.userStore.name}
; } } -export default view(NameCard) +export default view(NameCard); ``` Instead of returning an object, you should directly mutate the received stores. If you have multiple local stores on a single component, they are all passed as arguments - in their definition order - after the first props argument. @@ -615,4 +636,4 @@ If you use a bundler, set up an alias for `react-easy-state` to point to your de ## Contributing -Contributions are always welcome. Just send a PR against the master branch or open a new issue. Please make sure that the tests and the linter pass and the coverage remains decent. Thanks! +Contributions are always welcome. Please read our [contributing documentation](CONTRIBUTING.md). Thanks! From d23b882c362f46593e7ec81fea3c86622c83fbb0 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2020 15:45:08 +0100 Subject: [PATCH 4/7] docs: add solkimicreb as a contributor (#118) * docs: update README.md [skip ci] * docs: create .all-contributorsrc [skip ci] Co-authored-by: Roland --- .all-contributorsrc | 24 ++++++++++++++++++++++++ README.md | 23 +++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .all-contributorsrc diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 0000000..192e2be --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,24 @@ +{ + "files": [ + "README.md" + ], + "imageSize": 100, + "commit": false, + "contributors": [ + { + "login": "solkimicreb", + "name": "Miklos Bertalan", + "avatar_url": "https://avatars3.githubusercontent.com/u/6956014?v=4", + "profile": "https://bertalan-miklos.now.sh/", + "contributions": [ + "code" + ] + } + ], + "contributorsPerLine": 7, + "projectName": "react-easy-state", + "projectOwner": "RisingStack", + "repoType": "github", + "repoHost": "https://github.com", + "skipCi": true +} diff --git a/README.md b/README.md index d776d94..aa7bef8 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,10 @@ Simple React state management. Made with :heart: and ES6 Proxies. [![Build](https://img.shields.io/circleci/project/github/RisingStack/react-easy-state/master.svg)](https://circleci.com/gh/RisingStack/react-easy-state/tree/master) [![dependencies Status](https://david-dm.org/RisingStack/react-easy-state/status.svg)](https://david-dm.org/RisingStack/react-easy-state) [![Coverage Status](https://coveralls.io/repos/github/RisingStack/react-easy-state/badge.svg?branch=master&service=github)](https://coveralls.io/github/RisingStack/react-easy-state?branch=master) [![Package size](https://img.shields.io/bundlephobia/minzip/react-easy-state.svg)](https://bundlephobia.com/result?p=react-easy-state) [![Version](https://img.shields.io/npm/v/react-easy-state.svg)](https://www.npmjs.com/package/react-easy-state) [![License](https://img.shields.io/npm/l/react-easy-state.svg)](https://www.npmjs.com/package/react-easy-state) [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Simple%20React%20state%20management.%20Made%20with%20%E2%9D%A4%EF%B8%8F%20and%20ES6%20Proxies.&url=https://github.com/RisingStack/react-easy-state&hashtags=reactjs,webdev,javascript) + +[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-) + + Browser support **NEWS:** v6.1.2 fixed a nasty memory leak. Please upgrade to v6.1.2+ if you use a v6.x version already. Thanks! @@ -637,3 +641,22 @@ If you use a bundler, set up an alias for `react-easy-state` to point to your de ## Contributing Contributions are always welcome. Please read our [contributing documentation](CONTRIBUTING.md). Thanks! + +## Contributors ✨ + +Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): + + + + +
+ + + +

Miklos Bertalan

💻
+ + + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! From 5aa29064ee1fa5a18045b68b3c8becdd2755ba6b Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2020 15:52:04 +0100 Subject: [PATCH 5/7] docs: add rolandszoke as a contributor (#119) * docs: update README.md [skip ci] * docs: create .all-contributorsrc [skip ci] Co-authored-by: Roland --- .all-contributorsrc | 9 +++++++++ README.md | 1 + 2 files changed, 10 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 192e2be..1539927 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -13,6 +13,15 @@ "contributions": [ "code" ] + }, + { + "login": "rolandszoke", + "name": "Roland", + "avatar_url": "https://avatars3.githubusercontent.com/u/14181908?v=4", + "profile": "https://github.com/rolandszoke", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index aa7bef8..da8ff2c 100644 --- a/README.md +++ b/README.md @@ -651,6 +651,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d +

Roland

💻

Miklos Bertalan

💻
From 4c01246b9cd59098944ceddccf15e64886addd4d Mon Sep 17 00:00:00 2001 From: Roland Szoke Date: Fri, 21 Feb 2020 15:56:27 +0100 Subject: [PATCH 6/7] docs(contributors): change order of contributors --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index da8ff2c..af79e7d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,9 @@ Simple React state management. Made with :heart: and ES6 Proxies. [![Build](https://img.shields.io/circleci/project/github/RisingStack/react-easy-state/master.svg)](https://circleci.com/gh/RisingStack/react-easy-state/tree/master) [![dependencies Status](https://david-dm.org/RisingStack/react-easy-state/status.svg)](https://david-dm.org/RisingStack/react-easy-state) [![Coverage Status](https://coveralls.io/repos/github/RisingStack/react-easy-state/badge.svg?branch=master&service=github)](https://coveralls.io/github/RisingStack/react-easy-state?branch=master) [![Package size](https://img.shields.io/bundlephobia/minzip/react-easy-state.svg)](https://bundlephobia.com/result?p=react-easy-state) [![Version](https://img.shields.io/npm/v/react-easy-state.svg)](https://www.npmjs.com/package/react-easy-state) [![License](https://img.shields.io/npm/l/react-easy-state.svg)](https://www.npmjs.com/package/react-easy-state) [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Simple%20React%20state%20management.%20Made%20with%20%E2%9D%A4%EF%B8%8F%20and%20ES6%20Proxies.&url=https://github.com/RisingStack/react-easy-state&hashtags=reactjs,webdev,javascript) + [![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-) + Browser support @@ -35,6 +37,7 @@ Simple React state management. Made with :heart: and ES6 Proxies. - [Platform support](#platform-support) - [Alternative builds](#alternative-builds) - [Contributing](#contributing) + - [Contributors ✨](#contributors-%e2%9c%a8) @@ -651,13 +654,14 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d - +

Roland

💻

Miklos Bertalan

💻

Roland Szoke

💻
+ This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! From d382618cdfbae74b76351f31ab97e719b60c7499 Mon Sep 17 00:00:00 2001 From: Roland Szoke Date: Tue, 25 Feb 2020 13:37:42 +0100 Subject: [PATCH 7/7] docs(toc): revert toc changes --- .prettierignore | 1 + CONTRIBUTING.md | 4 ---- README.md | 39 ++++++++++++++------------------------- 3 files changed, 15 insertions(+), 29 deletions(-) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..b43bf86 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +README.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e19549a..f7292f9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -27,7 +27,3 @@ This project is using [ESLint](https://eslint.org/) for linting and [Prettier](h ## Tests To run our tests use `npm t` script. We are using [Jest](https://jestjs.io/) and [React Testing Library](https://github.com/testing-library/react-testing-library) for testing. Consider creating new test cases when necessary under the `__tests__` folder, we want to keep our test covarage above 90%. Use `.test.js` or `.test.jsx` suffix for test files and `.test.native.js` or `.test.native.jsx` for native tests. - -## Build process - -TODO diff --git a/README.md b/README.md index af79e7d..8e4f6df 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,7 @@ Simple React state management. Made with :heart: and ES6 Proxies. -[![Build](https://img.shields.io/circleci/project/github/RisingStack/react-easy-state/master.svg)](https://circleci.com/gh/RisingStack/react-easy-state/tree/master) [![dependencies Status](https://david-dm.org/RisingStack/react-easy-state/status.svg)](https://david-dm.org/RisingStack/react-easy-state) [![Coverage Status](https://coveralls.io/repos/github/RisingStack/react-easy-state/badge.svg?branch=master&service=github)](https://coveralls.io/github/RisingStack/react-easy-state?branch=master) [![Package size](https://img.shields.io/bundlephobia/minzip/react-easy-state.svg)](https://bundlephobia.com/result?p=react-easy-state) [![Version](https://img.shields.io/npm/v/react-easy-state.svg)](https://www.npmjs.com/package/react-easy-state) [![License](https://img.shields.io/npm/l/react-easy-state.svg)](https://www.npmjs.com/package/react-easy-state) [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Simple%20React%20state%20management.%20Made%20with%20%E2%9D%A4%EF%B8%8F%20and%20ES6%20Proxies.&url=https://github.com/RisingStack/react-easy-state&hashtags=reactjs,webdev,javascript) - - - -[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-) - - +[![Build](https://img.shields.io/circleci/project/github/RisingStack/react-easy-state/master.svg)](https://circleci.com/gh/RisingStack/react-easy-state/tree/master) [![dependencies Status](https://david-dm.org/RisingStack/react-easy-state/status.svg)](https://david-dm.org/RisingStack/react-easy-state) [![Coverage Status](https://coveralls.io/repos/github/RisingStack/react-easy-state/badge.svg?branch=master&service=github)](https://coveralls.io/github/RisingStack/react-easy-state?branch=master) [![Package size](https://img.shields.io/bundlephobia/minzip/react-easy-state.svg)](https://bundlephobia.com/result?p=react-easy-state) [![Version](https://img.shields.io/npm/v/react-easy-state.svg)](https://www.npmjs.com/package/react-easy-state) [![License](https://img.shields.io/npm/l/react-easy-state.svg)](https://www.npmjs.com/package/react-easy-state) [![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-) Browser support @@ -20,24 +14,19 @@ Simple React state management. Made with :heart: and ES6 Proxies. -- [React Easy State](#react-easy-state) - - [Introduction](#introduction) - - [Installation](#installation) - - [Usage](#usage) - - [Creating global stores](#creating-global-stores) - - [Creating reactive views](#creating-reactive-views) - - [Creating local stores](#creating-local-stores) - - [Local stores in function components](#local-stores-in-function-components) - - [Local stores in class components](#local-stores-in-class-components) - - [Examples with live demos](#examples-with-live-demos) - - [Beginner](#beginner) - - [Advanced](#advanced) - - [Articles](#articles) - - [Performance](#performance) - - [Platform support](#platform-support) - - [Alternative builds](#alternative-builds) - - [Contributing](#contributing) - - [Contributors ✨](#contributors-%e2%9c%a8) +* [Introduction](#introduction) +* [Installation](#installation) +* [Usage](#usage) + + [Creating global stores](#creating-global-stores) + + [Creating reactive views](#creating-reactive-views) + + [Creating local stores](#creating-local-stores) +* [Examples with live demos](#examples-with-live-demos) +* [Articles](#articles) +* [Performance](#performance) +* [Platform support](#platform-support) +* [Alternative builds](#alternative-builds) +* [Contributing](#contributing) +* [Contributors ✨](#contributors-%E2%9C%A8)