From a148266dc136cf72140ac110c07b51ff56138003 Mon Sep 17 00:00:00 2001 From: Martti Malmi Date: Tue, 28 Sep 2021 13:07:39 +0300 Subject: [PATCH] . --- _posts/2021-9-27-gun-for-react-state-management.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_posts/2021-9-27-gun-for-react-state-management.md b/_posts/2021-9-27-gun-for-react-state-management.md index 82c856c..42b3a1a 100644 --- a/_posts/2021-9-27-gun-for-react-state-management.md +++ b/_posts/2021-9-27-gun-for-react-state-management.md @@ -14,7 +14,7 @@ Fed up with writing a ton of Redux boilerplate just to handle form input changes There’s a better alternative: [Gun.js](https://github.com/amark/gun). It makes state synchronization and persistence a breeze. -First, initialize Gun with options that make sure the state is synced with localStorage only (not with peers). +First, initialize Gun with options that ensure the state is synced with localStorage only (not with peers). ```jsx const State = new Gun({ localStorage: true, @@ -51,7 +51,7 @@ class TextInput extends React.Component { } ``` -Now you have a text form that syncs its content across component instances and persists it in localStorage. +Now you have a text input that syncs its content across component instances and persists it in localStorage. See the working example on [Codepen](https://codepen.io/mmalmi/pen/VwWVdKG).