Skip to content

Commit 0731cb0

Browse files
committed
Updated docs
1 parent c045c90 commit 0731cb0

File tree

5 files changed

+6815
-17
lines changed

5 files changed

+6815
-17
lines changed

.gitignore

100755100644
+4
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33
*~
44
*.log
55
node_modules
6+
*.env
7+
.DS_Store
8+
package-lock.json
9+
.bloggify/*

DOCUMENTATION.md

+23-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ You can see below the API reference of this module.
66
Finds the value of parameter passed in first argument.
77

88
#### Params
9+
910
- **String** `name`: The parameter name.
1011
- **Boolean** `notDecoded`: If `true`, the result will be encoded.
1112

@@ -19,6 +20,7 @@ the parameter is there, but it doesn't have a value, the value will
1920
be `true`.
2021

2122
#### Params
23+
2224
- **String** `search`: An optional string that should be parsed (default: `window.location.search`).
2325

2426
#### Return
@@ -28,6 +30,7 @@ be `true`.
2830
Stringifies a query object.
2931

3032
#### Params
33+
3134
- **Object** `queryObj`: The object that should be stringified.
3235

3336
#### Return
@@ -37,6 +40,7 @@ Stringifies a query object.
3740
Adds, updates or deletes a parameter (without page refresh).
3841

3942
#### Params
43+
4044
- **String|Object** `param`: The parameter name or name-value pairs as object.
4145
- **String** `value`: The parameter value. If `undefined`, the parameter will be removed.
4246
- **Boolean** `push`: If `true`, the page will be kept in the history, otherwise the location will be changed but by pressing the back button
@@ -50,6 +54,7 @@ will not bring you to the old location.
5054
Returns the page url, but not including the domain name.
5155

5256
#### Params
57+
5358
- **Boolean** `excludeHash`: If `true`, the location hash will not be appended in the result.
5459

5560
#### Return
@@ -59,8 +64,9 @@ Returns the page url, but not including the domain name.
5964
Sets/gets the hash value.
6065

6166
#### Params
67+
6268
- **String** `newHash`: The hash to set.
63-
- **Boolean** `triggerPopState`: Triggers the popstate handlers (by default falsly).
69+
- **Boolean** `triggerPopState`: Triggers the hashchange (by default falsly).
6470

6571
#### Return
6672
- **String** The location hash.
@@ -69,6 +75,7 @@ Sets/gets the hash value.
6975
Update the full url (pathname, search, hash).
7076

7177
#### Params
78+
7279
- **String** `s`: The new url to set.
7380
- **Boolean** `push`: If `true`, the page will be kept in the history, otherwise the location will be changed but by pressing the back button
7481
will not bring you to the old location.
@@ -77,11 +84,11 @@ will not bring you to the old location.
7784
#### Return
7885
- **String** The set url.
7986

80-
### `getLocation(pathname, push, triggerPopState)`
81-
pathname
87+
### `pathname(pathname, push, triggerPopState)`
8288
Sets/gets the pathname.
8389

8490
#### Params
91+
8592
- **String** `pathname`: The pathname to set.
8693
- **Boolean** `push`: If `true`, the page will be kept in the history, otherwise the location will be changed but by pressing the back button
8794
will not bring you to the old location.
@@ -90,19 +97,31 @@ will not bring you to the old location.
9097
#### Return
9198
- **String** The set url.
9299

100+
### `triggerHashchangeCb()`
101+
Calls the hashchange handlers.
102+
93103
### `triggerPopStateCb()`
94104
Calls the popstate handlers.
95105

96106
### `onPopState(cb)`
97107
Adds a popstate handler.
98108

99109
#### Params
110+
111+
- **Function** `cb`: The callback function.
112+
113+
### `onHashchange(cb)`
114+
Adds a hashchange handler.
115+
116+
#### Params
117+
100118
- **Function** `cb`: The callback function.
101119

102120
### `removeHash(push, trigger)`
103121
Removes the hash from the url.
104122

105123
#### Params
124+
106125
- **Boolean** `push`: If `true`, the page will be kept in the history, otherwise the location will be changed but by pressing the back button
107126
will not bring you to the old location.
108127
- **Boolean** `trigger`: Triggers the popstate handlers (by default falsly).
@@ -111,6 +130,7 @@ will not bring you to the old location.
111130
Removes the querystring parameters from the url.
112131

113132
#### Params
133+
114134
- **Boolean** `push`: If `true`, the page will be kept in the history, otherwise the location will be changed but by pressing the back button
115135
will not bring you to the old location.
116136
- **Boolean** `trigger`: Triggers the popstate handlers (by default falsly).

0 commit comments

Comments
 (0)