UNPKG

@devcycle/nextjs-sdk

Version:

The Next.js SDK for DevCycle!

16 lines 681 B
'use client'; import { useDevCycleClient } from './internal/useDevCycleClient'; import { useRerenderOnVariableChange } from './internal/useRerenderOnVariableChange'; import { use, useContext } from 'react'; import { DevCycleProviderContext } from './internal/context'; export const useAllFeatures = () => { const client = useDevCycleClient(); const context = useContext(DevCycleProviderContext); useRerenderOnVariableChange(); // Fall back to nearest suspense boundary if client is not initialized yet. if (context.enableStreaming) { use(client.onClientInitialized()); } return client.allFeatures(); }; //# sourceMappingURL=useAllFeatures.js.map