Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4114146
statsv.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
statsv.js
View Options
import
actionTypes
from
'./../actionTypes'
;
import
nextState
from
'./nextState'
;
/**
* Reducer for actions that may result in an event being logged via statsv.
*
* @param {Object|undefined} state
* @param {Object} action
* @return {Object} state after action
*/
export
default
function
statsv
(
state
,
action
)
{
state
=
state
||
{};
switch
(
action
.
type
)
{
case
actionTypes
.
FETCH_START
:
return
nextState
(
state
,
{
fetchStartedAt
:
action
.
timestamp
}
);
case
actionTypes
.
FETCH_END
:
return
nextState
(
state
,
{
action
:
'timing.PagePreviewsApiResponse'
,
data
:
action
.
timestamp
-
state
.
fetchStartedAt
}
);
case
actionTypes
.
FETCH_FAILED
:
return
nextState
(
state
,
{
action
:
'counter.PagePreviewsApiFailure'
,
data
:
1
}
);
case
actionTypes
.
LINK_DWELL
:
return
nextState
(
state
,
{
linkDwellStartedAt
:
action
.
timestamp
}
);
case
actionTypes
.
PREVIEW_SHOW
:
return
nextState
(
state
,
{
action
:
'timing.PagePreviewsPreviewShow'
,
data
:
action
.
timestamp
-
state
.
linkDwellStartedAt
}
);
case
actionTypes
.
STATSV_LOGGED
:
return
nextState
(
state
,
{
action
:
null
,
data
:
null
}
);
default
:
return
state
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, Aug 18, 23:52 (14 h, 47 m ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
01/e2/52517f163fe6b363323e3d4dc33a
Default Alt Text
statsv.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment