You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Glossary.md
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ A *leave hook* is a user-defined function that is called when a route is about t
42
42
pathname: Pathname;
43
43
search: QueryString;
44
44
query: Query;
45
-
state: any;
45
+
state: LocationState;
46
46
action: Action;
47
47
key: string;
48
48
};
@@ -54,6 +54,14 @@ A *location* answers two important (philosophical) questions:
54
54
55
55
New locations are typically created each time the URL changes. You can read more about locations in [the `history` docs](https://github.com/rackt/history/blob/master/docs/Location.md).
56
56
57
+
### LocationState
58
+
59
+
type LocationState = any;
60
+
61
+
A *location state* is an arbitrary object of data associated with a particular [`location`](#location). This is basically a way to tie extra state to a location that is not contained in the URL.
62
+
63
+
This type gets its name from the first argument to HTML5's [`pushState`](https://developer.mozilla.org/en-US/docs/Web/API/History_API#The_pushState(\)_method) and [`replaceState`](https://developer.mozilla.org/en-US/docs/Web/API/History_API#The_replaceState(\)_method) methods.
64
+
57
65
### Pathname
58
66
59
67
type Pathname = string;
@@ -64,7 +72,7 @@ A *pathname* is the portion of a URL that describes a hierarchical path, includi
64
72
65
73
type QueryString = string;
66
74
67
-
A *query string* is the portion of the URL that trails the [pathname](#pathname), including the preceeding `?`. For example, in `http://example.com/the/path?the=query`, `?the=query` is the query string. It is synonymous with `window.location.search` in web browsers.
75
+
A *query string* is the portion of the URL that follows the [pathname](#pathname), including any preceeding `?`. For example, in `http://example.com/the/path?the=query`, `?the=query` is the query string. It is synonymous with `window.location.search` in web browsers.
68
76
69
77
### Query
70
78
@@ -80,7 +88,7 @@ The word *params* refers to an object of key/value pairs that were parsed out of
0 commit comments