Skip to content

Commit

Permalink
Merge pull request #223 from Flagsmith/feat/v4
Browse files Browse the repository at this point in the history
feat: v4
  • Loading branch information
kyle-ssg authored Apr 8, 2024
2 parents 68fe0e8 + ba688c3 commit 6253e7e
Show file tree
Hide file tree
Showing 21 changed files with 600 additions and 525 deletions.
708 changes: 300 additions & 408 deletions flagsmith-core.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index-es.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IFlagsmith } from './types';

import fetch from "unfetch"
import AsyncStorage from "./async-storage";
import AsyncStorage from "./utils/async-storage";
import core, { LikeFetch } from './flagsmith-core';
// @ts-ignore
globalThis.FlagsmithEventSource = typeof EventSource!== "undefined"? EventSource: null;
Expand Down
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IFlagsmith } from './types';
globalThis.FlagsmithEventSource = typeof EventSource!== "undefined"? EventSource: null;

import fetch from "unfetch"
import AsyncStorage from "./async-storage";
import AsyncStorage from "./utils/async-storage";
import core, { LikeFetch } from './flagsmith-core';
import _EventSource from 'reconnecting-eventsource'
// @ts-expect-error
Expand Down
2 changes: 1 addition & 1 deletion isomorphic-es.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import AsyncStorage from "./async-storage";
import AsyncStorage from "./utils/async-storage";
import {IFlagsmith} from "./types";
// @ts-expect-error
globalThis.FlagsmithEventSource = typeof EventSource !== 'undefined' ? EventSource : null;
Expand Down
2 changes: 1 addition & 1 deletion isomorphic.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import AsyncStorage from "./async-storage";
import AsyncStorage from "./utils/async-storage";
import {IFlagsmith} from "./types";
import core from './flagsmith-core'

Expand Down
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": "3.24.0",
"version": "4.0.0",
"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": "3.24.0",
"version": "4.0.0",
"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": "3.24.0",
"version": "4.0.0",
"description": "Feature flagging to support continuous development",
"main": "./index.js",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions react.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React, {
useRef,
useState,
} from 'react';
import Emitter from './emitter';
import Emitter from './utils/emitter';
const events = new Emitter();

import { IFlagsmith, IFlagsmithTrait, IFlagsmithFeature, IState } from './types'
Expand Down Expand Up @@ -111,7 +111,7 @@ export function useFlagsmithLoading() {
}

useEffect(() => {
if (!subscribed && flagsmith.initialised) {
if (!subscribed && flagsmith?.initialised) {
events.on('loading_event', eventListener)
setSubscribed(true)
}
Expand Down
Loading

0 comments on commit 6253e7e

Please sign in to comment.