@accounts/client
Advanced tools
Comparing version 0.0.4-alpha.9b2e36fb to 0.0.4-alpha.c26460cb
@@ -36,2 +36,4 @@ 'use strict'; | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
@@ -63,6 +65,4 @@ | ||
this.store = (0, _createStore2.default)({ | ||
reducers: { | ||
accounts: _module2.default | ||
}, | ||
this.store = options.store || (0, _createStore2.default)({ | ||
reducers: _defineProperty({}, options.reduxStoreKey, _module2.default), | ||
middleware: middleware | ||
@@ -75,3 +75,9 @@ }); | ||
value: function getState() { | ||
return this.store.getState().get('accounts'); | ||
var state = this.store.getState(); | ||
if (typeof state.get === 'function') { | ||
return state.get(this.options.reduxStoreKey); | ||
} | ||
return state[this.options.reduxStoreKey]; | ||
} | ||
@@ -78,0 +84,0 @@ }, { |
@@ -22,3 +22,5 @@ 'use strict'; | ||
exports.default = _extends({}, _common.config, { | ||
store: null, | ||
reduxLogger: null, | ||
reduxStoreKey: 'accounts', | ||
server: '', | ||
@@ -25,0 +27,0 @@ localStoragePrefix: '', |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.config = exports.AccountsClient = undefined; | ||
exports.reducer = exports.config = exports.AccountsClient = undefined; | ||
@@ -17,2 +17,6 @@ var _AccountsClient = require('./AccountsClient'); | ||
var _module = require('./module'); | ||
var _module2 = _interopRequireDefault(_module); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -22,2 +26,3 @@ | ||
exports.AccountsClient = _AccountsClient.AccountsClient; | ||
exports.config = _config2.default; | ||
exports.config = _config2.default; | ||
exports.reducer = _module2.default; |
{ | ||
"name": "@accounts/client", | ||
"version": "0.0.4-alpha.9b2e36fb", | ||
"version": "0.0.4-alpha.c26460cb", | ||
"description": "Fullstack authentication and accounts-management", | ||
@@ -67,3 +67,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@accounts/common": "^0.0.4-alpha.9b2e36fb", | ||
"@accounts/common": "^0.0.4-alpha.c26460cb", | ||
"immutable": "^3.8.1", | ||
@@ -70,0 +70,0 @@ "jwt-decode": "^2.1.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
126788
2348