diff --git a/docs/useSet.md b/docs/useSet.md index 55407202..66b9cc0d 100644 --- a/docs/useSet.md +++ b/docs/useSet.md @@ -4,16 +4,22 @@ React state hook that tracks a [Set](https://developer.mozilla.org/en-US/docs/We ## Usage +What is the difference between the "clear()" method and the "reset()" method? + +The "reset()" method returns the "Set" to the initial value passed during "useSet +The "clear()" method completely empties the "Set". + ```jsx import {useSet} from 'react-use'; const Demo = () => { - const [set, { add, has, remove, toggle, reset }] = useSet(new Set(['hello'])); + const [set, { add, has, remove, toggle, reset, clear }] = useSet(new Set(['hello'])); return (
+ diff --git a/stories/useSet.story.tsx b/stories/useSet.story.tsx index 82c298ad..197d996a 100644 --- a/stories/useSet.story.tsx +++ b/stories/useSet.story.tsx @@ -4,12 +4,13 @@ import { useSet } from '../src'; import ShowDocs from './util/ShowDocs'; const Demo = () => { - const [set, { add, has, remove, reset, toggle }] = useSet(new Set(['hello'])); + const [set, { add, has, remove, reset, clear, toggle }] = useSet(new Set(['hello'])); return (
+