Skip to content

Commit

Permalink
docs: ✏️ improve createMemo docs
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Oct 29, 2018
1 parent 8730eaa commit 10c6906
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<br/>
<br/>
- [**State**](./docs/State.md)
- [`createMemo`](./docs/createMemo.md) &mdash; creates a memoized hook.
- [`createMemo`](./docs/createMemo.md) &mdash; factory of memoized hooks.
- [`useGetSet`](./docs/useGetSet.md) &mdash; returns state getter `get()` instead of raw state.
- [`useGetSetState`](./docs/useGetSetState.md) &mdash; as if [`useGetSet`](./docs/useGetSet.md) and [`useSetState`](./docs/useSetState.md) had a baby.
- [`useObservable`](./docs/useObservable.md) &mdash; tracks latest value of an `Observable`.
Expand Down
10 changes: 9 additions & 1 deletion docs/createMemo.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# `createMemo`

A factory that returns a React hook, which is memoized for each set of arguments passed to it.
Hook factory, receives a function to be memoized, returns a memoized React hook,
which receives the same arguments and returns the same result as the original function.


## Usage
Expand All @@ -26,3 +27,10 @@ const Demo = () => {
);
};
```


## Reference

```js
const useMemoFn = createMemo(fn);
```

0 comments on commit 10c6906

Please sign in to comment.