Skip to content

Commit bbf47f9

Browse files
committed
Allow any object type for useFlags generic
Convert to function to allow overrides Closes #139
1 parent 629c2d9 commit bbf47f9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/useFlags.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ import context, { ReactSdkContext } from './context';
1010
*
1111
* @return All the feature flags configured in your LaunchDarkly project
1212
*/
13-
const useFlags = <T extends LDFlagSet = LDFlagSet>(): T => {
13+
// tslint:disable-next-line:no-any
14+
function useFlags<T extends Record<string, any> = LDFlagSet>(): T {
1415
const { flags } = useContext<ReactSdkContext>(context);
1516

1617
return flags as T;
17-
};
18+
}
1819

1920
export default useFlags;

0 commit comments

Comments
 (0)