Skip to content

Commit

Permalink
feat: remove useReplicantOnce (#266)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: useReplicantOnce is removed because it is not so complicated to provide as a custom hook, and there is not much use for it.
  • Loading branch information
Hoishin authored Jan 1, 2024
1 parent 982680a commit be12d07
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 41 deletions.
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,6 @@ export function RunnerName() {
}
```

### `useReplicantOnce`

- Reads specified replicant value once, without subscribing to it.
- Uses `readReplicant` internally.
- Returns single value that will be updated once when it reads the value
- Does NOT subscribe to replicant value changes

```tsx
import {useReplicantOnce} from 'use-nodecg';

// Only reads the replicant value once and doesn't update
export function RunnerName() {
const count = useReplicantOnce('counter');
return <div>{count}</div>;
}
```

### `useListenFor`

- Subscribes messages with `listenFor`, and unlistens on unmount.
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from './use-replicant';
export * from './use-replicant-once';
export * from './use-listen-for';
23 changes: 0 additions & 23 deletions src/use-replicant-once.ts

This file was deleted.

0 comments on commit be12d07

Please sign in to comment.