Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rex Dri
Rex Dri
Commits
d2e97741
Verified
Commit
d2e97741
authored
Apr 12, 2020
by
Florent Chehab
Browse files
docs(global hooks helper): impove js doc
parent
5c0d6ab7
Changes
1
Hide whitespace changes
Inline
Side-by-side
frontend/src/hooks/useGlobalState.js
View file @
d2e97741
...
...
@@ -30,8 +30,8 @@ const globalStateListeners = new Map();
/**
* Helper to update all the listeners on the global state key
*
* @param key
* @param newValue
* @param
{string}
key
* @param
{any}
newValue
* @private
*/
function
updateGlobalStateListeners
(
key
,
newValue
)
{
...
...
@@ -45,8 +45,8 @@ function updateGlobalStateListeners(key, newValue) {
/**
* Helper to update the values in the global state and tel the associated listeners
*
* @param key
* @param newValue
* @param
{string}
key
* @param
{any}
newValue
*/
export
function
updateGlobalState
(
key
,
newValue
)
{
const
valueInStore
=
getPersistedValue
(
key
);
...
...
@@ -60,9 +60,9 @@ export function updateGlobalState(key, newValue) {
* Helper to reduce the value in the globalState (identified by a key)
* And trigger an update to all subscribers.
*
* @param key
* @param reducer
* @param action
* @param
{string}
key
* @param
{function(any, object): any}
reducer
* @param
{{type: string, ...}}
action
*/
export
function
reduceGlobalState
(
key
,
reducer
,
action
)
{
if
(
process
.
env
.
NODE_ENV
!==
"
production
"
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment