diff options
author | Noah Loomans <noahloomans@gmail.com> | 2018-07-03 19:33:51 +0200 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2018-07-03 19:33:51 +0200 |
commit | 5451dc2f5a09fa06df32d1a1661623b475170566 (patch) | |
tree | 8ca5c495aadd3654ec603c9c904f04fb5cfbb86a /src/client/react/lib/getHistory.js | |
parent | c1387d6e58669846c149c8b56500c05b1eb6a787 (diff) |
client: Document getHistory
Diffstat (limited to 'src/client/react/lib/getHistory.js')
-rw-r--r-- | src/client/react/lib/getHistory.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/client/react/lib/getHistory.js b/src/client/react/lib/getHistory.js index 5fef902..daa984b 100644 --- a/src/client/react/lib/getHistory.js +++ b/src/client/react/lib/getHistory.js @@ -5,7 +5,20 @@ import { makeUpdateQuery, } from './url'; +/** + * Make a getHistory function. This function is used in index.js when creating + * the redux store. + * @param {history} history + * The history object from the `history` package. + * There may only be a single shared history object in the application, which + * is why it's delivered from `../index.js`. + */ export default function makeGetHistory(history) { + /** + * Get a collection of helpers for common browser history interactions, and a + * collection of precalculated values from the address bar. This function is + * used in actions. + */ return function getHistory() { const user = userFromLocation(history.location); const week = weekFromLocation(history.location); |