Skip to content

Commit

Permalink
feat: export useOpenFeatureClientStatus hook (#1082)
Browse files Browse the repository at this point in the history
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->

## This PR
<!-- add the description of the PR here -->

exposes the internal open feature client status hook so developers can
act on non-ready resolved states

### Related Issues
<!-- add here the GitHub issue that this PR resolves if applicable -->

Fixes #1036

### Notes
<!-- any additional notes for this PR -->

### Follow-up Tasks
<!-- anything that is related to this PR but not done here should be
noted under this section -->
<!-- if there is a need for a new issue, please link it here -->

### How to test
<!-- if applicable, add testing instructions under this section -->

---------

Signed-off-by: William Chou <[email protected]>
Signed-off-by: Will Chou <[email protected]>
Co-authored-by: Lukas Reining <[email protected]>
  • Loading branch information
wichopy and lukas-reining authored Jan 28, 2025
1 parent 9e338f2 commit 4a6b860
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/react/src/provider/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './provider';
export * from './use-open-feature-client';
export * from './use-when-provider-ready';
export * from './use-open-feature-client-status';
export * from './test-provider';
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ProviderEvents } from '@openfeature/web-sdk';
*/
export function useOpenFeatureClientStatus(): ProviderStatus {
const client = useOpenFeatureClient();
const [status, setStatus] = useState(client.providerStatus);
const [status, setStatus] = useState<ProviderStatus>(client.providerStatus);

useEffect(() => {
const updateStatus = () => setStatus(client.providerStatus);
Expand Down

0 comments on commit 4a6b860

Please sign in to comment.