From f6d35c5da4bbdea53d5144812d28f11782434341 Mon Sep 17 00:00:00 2001 From: nullablebool Date: Fri, 6 Dec 2019 17:59:45 -0800 Subject: [PATCH] Favour BroadcastChannelStrategy for default The readme states that LocalStorageStrategy is the fallback however the code does not reflect this. --- src/strategies/defaultStrategy.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/strategies/defaultStrategy.js b/src/strategies/defaultStrategy.js index 7190736..5896332 100644 --- a/src/strategies/defaultStrategy.js +++ b/src/strategies/defaultStrategy.js @@ -2,15 +2,15 @@ import BroadcastChannelStrategy from "./broadcastChannel"; import LocalStorageStrategy from "./localStorage"; export default function createDefaultStrategy() { - /* istanbul ignore next: browser-dependent code */ - if (LocalStorageStrategy.available()) { - return new LocalStorageStrategy(); - } - /* istanbul ignore next: browser-dependent code */ if (BroadcastChannelStrategy.available()) { return new BroadcastChannelStrategy(); } + + /* istanbul ignore next: browser-dependent code */ + if (LocalStorageStrategy.available()) { + return new LocalStorageStrategy(); + } /* istanbul ignore next: browser-dependent code */ throw new Error("No strategies available");