Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99388225
useSafeState.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jan 24, 02:47
Size
318 B
Mime Type
text/x-java
Expires
Sun, Jan 26, 02:47 (2 d)
Engine
blob
Format
Raw Data
Handle
23788760
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
useSafeState.js
View Options
import
{
useCallback
}
from
'react'
;
import
useMounted
from
'./useMounted'
;
function
useSafeState
(
state
)
{
var
isMounted
=
useMounted
();
return
[
state
[
0
],
useCallback
(
function
(
nextState
)
{
if
(
!
isMounted
())
return
;
return
state
[
1
](
nextState
);
},
[
isMounted
,
state
[
1
]])];
}
export
default
useSafeState
;
Event Timeline
Log In to Comment