Skip to content

Commit

Permalink
fix: rename story's mediator and add g flag to it's regex;
Browse files Browse the repository at this point in the history
fix: typo in readme;
  • Loading branch information
xobotyi committed Oct 16, 2019
1 parent cb4a735 commit 652b318
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
- [`useList`](./docs/useList.md) and [`useUpsert`](./docs/useUpsert.md) — tracks state of an array. [![][img-demo]](https://codesandbox.io/s/wonderful-mahavira-1sm0w)
- [`useMap`](./docs/useMap.md) — tracks state of an object. [![][img-demo]](https://codesandbox.io/s/quirky-dewdney-gi161)
- [`useStateValidator`](./docs/useStateValidator.md) — tracks state of an object. [![][img-demo]](https://streamich.github.io/react-use/?path=/story/state-usestatevalidator--demo)
- [`useMedisatedState`](./docs/useMediatedState.md) — like the regular `useState` but with mediation by custom function. [![][img-demo]](https://streamich.github.io/react-use/?path=/story/state-usemediatedstate--demo)
- [`useMediatedState`](./docs/useMediatedState.md) — like the regular `useState` but with mediation by custom function. [![][img-demo]](https://streamich.github.io/react-use/?path=/story/state-usemediatedstate--demo)

<br />
<br />
Expand Down
4 changes: 2 additions & 2 deletions src/__stories__/useMediatedState.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import * as React from 'react';
import { useMediatedState } from '../useMediatedState';
import ShowDocs from './util/ShowDocs';

const InputMediator = s => s.replace(/[\s]+/, ' ');
const inputMediator = s => s.replace(/[\s]+/g, ' ');
const Demo = () => {
const [state, setState] = useMediatedState(InputMediator, '');
const [state, setState] = useMediatedState(inputMediator, '');

return (
<div>
Expand Down

0 comments on commit 652b318

Please sign in to comment.