navigation-stack 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +5 -21
  2. package/package.json +3 -4
package/README.md CHANGED
@@ -1,27 +1,9 @@
1
- <!-- START doctoc generated TOC please keep comment here to allow auto update -->
2
- <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3
- **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
4
-
5
- - [navigation-stack](#navigation-stack)
6
- - [Install](#install)
7
- - [Use](#use)
8
- - [Current Location](#current-location)
9
- - [Why Redux?](#why-redux)
10
- - [Environment](#environment)
11
- - [Base Path](#base-path)
12
- - [Location State Storage](#location-state-storage)
13
- - [Block Navigation](#block-navigation)
14
- - [Utility](#utility)
15
- - [Development](#development)
16
-
17
- <!-- END doctoc generated TOC please keep comment here to allow auto update -->
18
-
19
1
  # navigation-stack
20
2
 
21
3
  [![npm version](https://img.shields.io/npm/v/navigation-stack.svg?style=flat-square)](https://www.npmjs.com/package/navigation-stack)
22
4
  [![npm downloads](https://img.shields.io/npm/dm/navigation-stack.svg?style=flat-square)](https://www.npmjs.com/package/navigation-stack)
23
5
 
24
- Handles web browser navigation in a web application.
6
+ Handles navigation in a web browser. Represents web browser navigation history as a "stack" data structure. Provides operations to perform programmatic navigation such as "push" (go to new URL), "replace" (redirect to new URL), "shift" (rewind to a previously visited URL). Provides a subscription mechanism to get notified on current location change.
25
7
 
26
8
  Originally forked from [`farce`](http://npmjs.com/package/farce) package to fix a [bug](https://github.com/4Catalyzer/farce/issues/483).
27
9
 
@@ -102,9 +84,11 @@ function reducer(state, action) {
102
84
  }
103
85
  ```
104
86
 
105
- Calling `store.dispatch(Actions.init())` will trigger the initial `ActionTypes.UPDATE` action which will set the current location. From then on, the current location will always stay in sync with the web browser's URL bar.
87
+ With this reducer, `store.getState()` will return the current location.
88
+
89
+ Calling `store.dispatch(Actions.init())` will trigger the initial `ActionTypes.UPDATE` action which will set the initial current location. From then on, the current location will always stay in sync with the web browser's URL bar, including "Back"/"Forward" navigation.
106
90
 
107
- The current location will also "magically" be updated when the user clicks "Back" or "Forward" button in the web browser.
91
+ One could use Redux'es standard [subscription mechanisms](https://redux.js.org/api/store#subscribelistener) to immediately get notified of current location changes.
108
92
 
109
93
  ## Why Redux?
110
94
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "navigation-stack",
3
- "version": "0.1.0",
4
- "description": "Handles web browser navigation in a web application",
3
+ "version": "0.1.1",
4
+ "description": "Handles navigation in a web browser",
5
5
  "keywords": [
6
6
  "history",
7
7
  "browser",
@@ -40,8 +40,7 @@
40
40
  }
41
41
  },
42
42
  "lint-staged": {
43
- "*": "yarn 4c lint --fix --prettier-ignore .eslintignore",
44
- "README.md": "doctoc"
43
+ "*": "yarn 4c lint --fix --prettier-ignore .eslintignore"
45
44
  },
46
45
  "prettier": "@4c/prettier-config",
47
46
  "dependencies": {