Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@splitsoftware/splitio-commons",
"version": "3.0.0",
"version": "3.0.1-rc.1",
"description": "Split JavaScript SDK common components",
"main": "cjs/index.js",
"module": "esm/index.js",
Expand Down
3 changes: 2 additions & 1 deletion src/sdkClient/sdkLifecycle.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { releaseApiKey, validateAndTrackApiKey } from '../utils/inputValidation/apiKey';
import { ISdkFactoryContext } from '../sdkFactory/types';
import { LOCALHOST_MODE } from '../utils/constants';

const COOLDOWN_TIME_IN_MILLIS = 1000;

Expand All @@ -12,7 +13,7 @@ export function sdkLifecycleFactory(params: ISdkFactoryContext, isSharedClient?:
let hasInit = false;
let lastActionTime = 0;

const signalListener = platform.SignalListener && new platform.SignalListener(params);
const signalListener = platform.SignalListener && settings.mode !== LOCALHOST_MODE ? new platform.SignalListener(params) : undefined;

function __cooldown(func: Function, time: number) {
const now = Date.now();
Expand Down
6 changes: 1 addition & 5 deletions src/sdkFactory/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,7 @@ export interface ISdkFactoryParams {

// Sdk client method factory.
// It Allows to distinguish SDK clients with the client-side API (`IBrowserSDK` and `IBrowserAsyncSDK`) or server-side API (`ISDK` and `IAsyncSDK`).
sdkClientMethodFactory: (params: ISdkFactoryContext) => (
{ (): SplitIO.IBrowserClient & { init(): void }; (key: SplitIO.SplitKey): SplitIO.IBrowserClient & { init(): void }; } |
(() => SplitIO.IClient & { init(): void }) |
(() => SplitIO.IAsyncClient & { init(): void })
)
sdkClientMethodFactory: (params: ISdkFactoryContext) => ({ (): SplitIO.IBrowserClient; (key: SplitIO.SplitKey): SplitIO.IBrowserClient; } | (() => SplitIO.IClient) | (() => SplitIO.IAsyncClient))

// Impression observer factory.
impressionsObserverFactory: () => IImpressionObserver
Expand Down
4 changes: 1 addition & 3 deletions src/storages/inLocalStorage/MySegmentsCacheInLocal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import { StorageAdapter } from '../types';
export class MySegmentsCacheInLocal extends AbstractMySegmentsCacheSync {

private readonly keys: MySegmentsKeyBuilder;
private readonly log: ILogger;
private readonly storage: StorageAdapter;

constructor(log: ILogger, keys: MySegmentsKeyBuilder, storage: StorageAdapter) {
constructor(_log: ILogger, keys: MySegmentsKeyBuilder, storage: StorageAdapter) {
super();
this.log = log;
this.keys = keys;
this.storage = storage;
}
Expand Down
3 changes: 3 additions & 0 deletions src/utils/EventEmitter.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import SplitIO from '../../types/splitio';

export declare const EventEmitter: new () => SplitIO.IEventEmitter;