kit
GitHub
npm
Preparing search index...
@knitkode/browser
storageClient
storageClient
Function storageClient
storageClient
<
TConfig
extends
StorageClientConfig
=
StorageClientConfig
>
(
useSessionStorage
?:
boolean
,
)
:
{
get
:
<
TKey
extends
string
,
TValue
=
TConfig
[
TKey
]
>
(
key
:
TKey
,
transform
?:
(
value
:
string
)
=>
TValue
,
defaultValue
?:
TValue
|
null
,
)
=>
NonNullable
<
TValue
>
|
null
;
has
:
<
TKey
extends
string
,
TValue
=
TConfig
[
TKey
]
>
(
key
:
TKey
,
defaultValue
?:
TValue
,
)
=>
boolean
|
NonNullable
<
TValue
>
;
remove
:
<
TKey
extends
string
>
(
key
:
TKey
)
=>
void
;
set
:
<
TKey
extends
string
,
TValue
=
TConfig
[
TKey
]
>
(
key
:
TKey
,
value
?:
TValue
,
transform
?:
(
value
:
any
)
=>
string
,
)
=>
void
;
}
Super minifiable
local/session Storage
client creator with SSR safety
Type Parameters
TConfig
extends
StorageClientConfig
=
StorageClientConfig
Parameters
Optional
useSessionStorage
:
boolean
Returns
{
get
:
<
TKey
extends
string
,
TValue
=
TConfig
[
TKey
]
>
(
key
:
TKey
,
transform
?:
(
value
:
string
)
=>
TValue
,
defaultValue
?:
TValue
|
null
,
)
=>
NonNullable
<
TValue
>
|
null
;
has
:
<
TKey
extends
string
,
TValue
=
TConfig
[
TKey
]
>
(
key
:
TKey
,
defaultValue
?:
TValue
,
)
=>
boolean
|
NonNullable
<
TValue
>
;
remove
:
<
TKey
extends
string
>
(
key
:
TKey
)
=>
void
;
set
:
<
TKey
extends
string
,
TValue
=
TConfig
[
TKey
]
>
(
key
:
TKey
,
value
?:
TValue
,
transform
?:
(
value
:
any
)
=>
string
,
)
=>
void
;
}
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
GitHub
npm
kit
Loading...
Super minifiable
local/session Storageclient creator with SSR safety