Skip to content

Commit

Permalink
feat: 🎸 remove experimental hooks
Browse files Browse the repository at this point in the history
BREAKING CHANGE: useRenderProp and useAsync are removed
  • Loading branch information
streamich committed Dec 17, 2018
1 parent d9d23fd commit 533e26f
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 261 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,10 @@
<br/>
- [**State**](./docs/State.md)
- [`createMemo`](./docs/createMemo.md) &mdash; factory of memoized hooks.
- [`useAdopt`](./docs/useAdopt.md) &mdash; extract value from multiple render-prop (or FaCC) components.
- [`useCallbag`](./docs/useCallbag.md) &mdash; tracks latest value of a callbag.
- [`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`.
- [`useRenderProp`](./docs/useRenderProp.md) &mdash; extracts value from a render-prop or a FaCC.
- [`useSetState`](./docs/useSetState.md) &mdash; creates `setState` method which works like `this.setState`. [![][img-demo]](https://codesandbox.io/s/n75zqn1xp0)
- [`useToggle` and `useBoolean`](./docs/useToggle.md) &mdash; tracks state of a boolean.
- [`useCounter` and `useNumber`](./docs/useCounter.md) &mdash; tracks state of a number.
Expand Down
37 changes: 0 additions & 37 deletions docs/useAdopt.md

This file was deleted.

33 changes: 0 additions & 33 deletions docs/useRenderProp.md

This file was deleted.

105 changes: 0 additions & 105 deletions src/__stories__/useAdopt.story.tsx

This file was deleted.

31 changes: 0 additions & 31 deletions src/__stories__/useRenderProp.story.tsx

This file was deleted.

4 changes: 0 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import createMemo from './createMemo';
import useAdopt from './useAdopt';
import useAsync from './useAsync';
import useAudio from './useAudio';
import useBattery from './useBattery';
Expand Down Expand Up @@ -31,7 +30,6 @@ import useOrientation from './useOrientation';
import useOutsideClick from './useOutsideClick';
import useRaf from './useRaf';
import useRefMounted from './useRefMounted';
import useRenderProp from './useRenderProp';
import useSessionStorage from './useSessionStorage';
import useSetState from './useSetState';
import useSize from './useSize';
Expand All @@ -49,7 +47,6 @@ import useWait from './useWait';

export {
createMemo,
useAdopt,
useAsync,
useAudio,
useBattery,
Expand Down Expand Up @@ -81,7 +78,6 @@ export {
useOutsideClick,
useRaf,
useRefMounted,
useRenderProp,
useSessionStorage,
useSetState,
useSize,
Expand Down
19 changes: 0 additions & 19 deletions src/useAdopt.ts

This file was deleted.

30 changes: 0 additions & 30 deletions src/useRenderProp.ts

This file was deleted.

3 comments on commit 533e26f

@xiaoxiangmoe
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@streamich Why remove useAdopt and useRenderProp

@streamich
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They had a warning in readme:

WARNING: Don't use this, works only for functional components.

Given that they did not work correctly for class components, I thought it is better to remove them.

@xiaoxiangmoe
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I mistakenly thought that the functional component would have no this.

Please sign in to comment.