Skip to content

Commit b1aa273

Browse files
authored
Merge pull request #225 from Flagsmith/chore/fix-types
fix: onChange types
2 parents 6253e7e + a248249 commit b1aa273

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

lib/flagsmith-es/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flagsmith-es",
3-
"version": "4.0.0",
3+
"version": "4.0.1",
44
"description": "Feature flagging to support continuous development. This is an esm equivalent of the standard flagsmith npm module.",
55
"main": "./index.js",
66
"type": "module",

lib/flagsmith/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flagsmith",
3-
"version": "4.0.0",
3+
"version": "4.0.1",
44
"description": "Feature flagging to support continuous development",
55
"main": "./index.js",
66
"repository": {

lib/react-native-flagsmith/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-flagsmith",
3-
"version": "4.0.0",
3+
"version": "4.0.1",
44
"description": "Feature flagging to support continuous development",
55
"main": "./index.js",
66
"repository": {

types.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export declare type LoadingState = {
6969
source: FlagSource //Indicates freshness of flags
7070
}
7171

72-
export type OnChange = (previousFlags: IFlags<F> | null, params: IRetrieveInfo, loadingState:LoadingState) => void
72+
export type OnChange<F extends string = string> = (previousFlags: IFlags<F> | null, params: IRetrieveInfo, loadingState:LoadingState) => void
7373
export interface IInitConfig<F extends string = string, T extends string = string> {
7474
AsyncStorage?: any;
7575
api?: string;
@@ -88,7 +88,7 @@ export interface IInitConfig<F extends string = string, T extends string = strin
8888
headers?: object;
8989
identity?: string;
9090
traits?: ITraits<T>;
91-
onChange?: OnChange;
91+
onChange?: OnChange<F>;
9292
onError?: (err: Error) => void;
9393
preventFetch?: boolean;
9494
state?: IState;

0 commit comments

Comments
 (0)