@frontegg/redux-store 7.0.0-alpha.4 → 7.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.0.0-alpha.4
1
+ /** @license Frontegg v7.0.0-alpha.5
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.0.0-alpha.4
1
+ /** @license Frontegg v7.0.0-alpha.5
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -129,10 +129,12 @@ const createStore = options => {
129
129
  auditLogs: auditsState,
130
130
  audits: oldAuditsState
131
131
  });
132
- (0, _utils.devtools)(store, {
133
- name: `${appName} Store`,
134
- enabled: true
135
- });
132
+ if (typeof window !== 'undefined' && (localStorage['DEBUG_FRONTEGG_STORE'] === 'true' || process.env.NODE_ENV === 'development')) {
133
+ (0, _utils.devtools)(store, {
134
+ name: `${appName} Store`,
135
+ enabled: true
136
+ });
137
+ }
136
138
  const stateActions = {};
137
139
  const actions = {};
138
140
  _restApi.ContextHolder.setContext(options.context);
@@ -185,6 +187,9 @@ const createStore = options => {
185
187
  payload: true
186
188
  });
187
189
  }
190
+ if (holder) {
191
+ holder.store = fronteggStore;
192
+ }
188
193
  return fronteggStore;
189
194
  } else {
190
195
  const [authActions, authStateActions] = (0, _auth.buildAuthActions)(store, api, actions, snapshotAuthState);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontegg/redux-store",
3
- "version": "7.0.0-alpha.4",
3
+ "version": "7.0.0-alpha.5",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Frontegg LTD",
package/toolkit/store.js CHANGED
@@ -95,10 +95,12 @@ export const createStore = options => {
95
95
  auditLogs: auditsState,
96
96
  audits: oldAuditsState
97
97
  });
98
- devtools(store, {
99
- name: `${appName} Store`,
100
- enabled: true
101
- });
98
+ if (typeof window !== 'undefined' && (localStorage['DEBUG_FRONTEGG_STORE'] === 'true' || process.env.NODE_ENV === 'development')) {
99
+ devtools(store, {
100
+ name: `${appName} Store`,
101
+ enabled: true
102
+ });
103
+ }
102
104
  const stateActions = {};
103
105
  const actions = {};
104
106
  ContextHolder.setContext(options.context);
@@ -151,6 +153,9 @@ export const createStore = options => {
151
153
  payload: true
152
154
  });
153
155
  }
156
+ if (holder) {
157
+ holder.store = fronteggStore;
158
+ }
154
159
  return fronteggStore;
155
160
  } else {
156
161
  const [authActions, authStateActions] = buildAuthActions(store, api, actions, snapshotAuthState);