navigation-stack 0.3.0 → 0.3.1

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/README.md CHANGED
@@ -183,7 +183,7 @@ import { BrowserSession, LocationDataStorage } from 'navigation-stack'
183
183
 
184
184
  const session = new BrowserSession()
185
185
 
186
- const storage = new LocationDataStorage(session, { namespace?: 'optional-namespace' })
186
+ const storage = new LocationDataStorage(session, { namespace: 'my-namespace' })
187
187
 
188
188
  const location = { pathname: '/abc' }
189
189
 
@@ -7,10 +7,11 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
7
7
  class LocationDataStorage {
8
8
  constructor(environment, {
9
9
  namespace
10
- } = {}) {
10
+ }) {
11
11
  this._environment = environment;
12
12
  this._getFallbackLocationKey = _getLocationUrl.default;
13
- this._stateKeyPrefix = namespace ? `${namespace}|` : '';
13
+ this._stateKeyPrefix = `${namespace}|`;
14
+ // this._stateKeyPrefix = namespace ? `${namespace}|` : '';
14
15
  }
15
16
  get(location, key) {
16
17
  const stateKey = this._getStateKey(location, key);
@@ -2,10 +2,11 @@ import getLocationUrl from './getLocationUrl';
2
2
  export default class LocationDataStorage {
3
3
  constructor(environment, {
4
4
  namespace
5
- } = {}) {
5
+ }) {
6
6
  this._environment = environment;
7
7
  this._getFallbackLocationKey = getLocationUrl;
8
- this._stateKeyPrefix = namespace ? `${namespace}|` : '';
8
+ this._stateKeyPrefix = `${namespace}|`;
9
+ // this._stateKeyPrefix = namespace ? `${namespace}|` : '';
9
10
  }
10
11
  get(location, key) {
11
12
  const stateKey = this._getStateKey(location, key);
package/lib/index.d.ts CHANGED
@@ -265,7 +265,7 @@ export class MemorySession extends SessionBase {
265
265
  export const locationReducer: Reducer<Location, Action>;
266
266
 
267
267
  export class LocationDataStorage {
268
- constructor(session: Session, options?: { namespace?: string });
268
+ constructor(session: Session, options: { namespace: string });
269
269
 
270
270
  get(location: Location, key: string): any;
271
271
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "navigation-stack",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Handles navigation in a web browser",
5
5
  "keywords": [
6
6
  "history",
@@ -1,10 +1,11 @@
1
1
  import getLocationUrl from './getLocationUrl';
2
2
 
3
3
  export default class LocationDataStorage {
4
- constructor(environment, { namespace } = {}) {
4
+ constructor(environment, { namespace }) {
5
5
  this._environment = environment;
6
6
  this._getFallbackLocationKey = getLocationUrl;
7
- this._stateKeyPrefix = namespace ? `${namespace}|` : '';
7
+ this._stateKeyPrefix = `${namespace}|`;
8
+ // this._stateKeyPrefix = namespace ? `${namespace}|` : '';
8
9
  }
9
10
 
10
11
  get(location, key) {
package/types/index.d.ts CHANGED
@@ -265,7 +265,7 @@ export class MemorySession extends SessionBase {
265
265
  export const locationReducer: Reducer<Location, Action>;
266
266
 
267
267
  export class LocationDataStorage {
268
- constructor(session: Session, options?: { namespace?: string });
268
+ constructor(session: Session, options: { namespace: string });
269
269
 
270
270
  get(location: Location, key: string): any;
271
271