Skip to content

Commit

Permalink
Merge pull request #225 from Flagsmith/chore/fix-types
Browse files Browse the repository at this point in the history
fix: onChange types
  • Loading branch information
kyle-ssg authored Apr 24, 2024
2 parents 6253e7e + a248249 commit b1aa273
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/flagsmith-es/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flagsmith-es",
"version": "4.0.0",
"version": "4.0.1",
"description": "Feature flagging to support continuous development. This is an esm equivalent of the standard flagsmith npm module.",
"main": "./index.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion lib/flagsmith/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flagsmith",
"version": "4.0.0",
"version": "4.0.1",
"description": "Feature flagging to support continuous development",
"main": "./index.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion lib/react-native-flagsmith/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-flagsmith",
"version": "4.0.0",
"version": "4.0.1",
"description": "Feature flagging to support continuous development",
"main": "./index.js",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export declare type LoadingState = {
source: FlagSource //Indicates freshness of flags
}

export type OnChange = (previousFlags: IFlags<F> | null, params: IRetrieveInfo, loadingState:LoadingState) => void
export type OnChange<F extends string = string> = (previousFlags: IFlags<F> | null, params: IRetrieveInfo, loadingState:LoadingState) => void
export interface IInitConfig<F extends string = string, T extends string = string> {
AsyncStorage?: any;
api?: string;
Expand All @@ -88,7 +88,7 @@ export interface IInitConfig<F extends string = string, T extends string = strin
headers?: object;
identity?: string;
traits?: ITraits<T>;
onChange?: OnChange;
onChange?: OnChange<F>;
onError?: (err: Error) => void;
preventFetch?: boolean;
state?: IState;
Expand Down

0 comments on commit b1aa273

Please sign in to comment.