redux-database
Options
All
Public
Public/Protected
All
Inherited
Externals
Only exported
Menu
DB
MutableDB
constructor
cached
Tables
current
Context
reducer
state
store
subscribers
snapshot
commit
context
dispatch
get
observe
query
read
State
reset
revert
set
subscribe
table
transaction
truncate
Query
Subscription
Table
Data
Table
DBAction
empty
Table
guid
reducer
Type parameters
State
:
StateDefining
Hierarchy
MutableDB
Index
Constructors
constructor
Properties
cached
Tables
current
Context
reducer
state
store
subscribers
Accessors
snapshot
Methods
commit
context
dispatch
get
observe
query
read
State
reset
revert
set
subscribe
table
transaction
truncate
Constructors
constructor
new
MutableDB
(
state
:
State
, options
?:
{
context
?:
undefined
|
string
;
store
?:
Store
<
State
>
}
)
:
MutableDB
Parameters
state:
State
Default value
options:
{
context
?:
undefined
|
string
;
store
?:
Store
<
State
>
}
= {}
Optional
context
?:
undefined
|
string
Optional
store
?:
Store
<
State
>
Returns
MutableDB
Properties
Private
cached
Tables
cached
Tables
:
{}
Type declaration
[
key:
string
]:
MutableTable
<
Row
>
Private
Optional
current
Context
current
Context
:
undefined
|
string
Private
reducer
reducer
:
(
state
:
State
, action
:
DBAction
)
=>
State
Type declaration
(
state
:
State
, action
:
DBAction
)
:
State
Parameters
state:
State
action:
DBAction
Returns
State
Private
state
state
:
State
Private
Optional
store
store
:
Store
<
State
>
Private
subscribers
subscribers
:
Array
<
(
action
:
DBAction
)
=>
void
>
Accessors
snapshot
get
snapshot
(
)
:
DB
<
State
>
Returns
DB
<
State
>
Methods
commit
commit<K>
(
table
?:
K
, ids
?:
RowIdentififying
)
:
void
Type parameters
K
:
RowKeyOf
<
State
>
Parameters
Optional
table:
K
Optional
ids:
RowIdentififying
Returns
void
context
context
(
context
:
string
)
:
MutableDB
<
State
>
Parameters
context:
string
Returns
MutableDB
<
State
>
Private
dispatch
dispatch
(
action
:
DBAction
)
:
void
Parameters
action:
DBAction
Returns
void
get
get<K>
(
name
:
K
)
:
SettingsType
<
State
,
K
>
Type parameters
K
:
SettingsKey
<
State
>
Parameters
name:
K
Returns
SettingsType
<
State
,
K
>
observe
observe<T>
(
query
:
(
db
:
DB
<
State
>
)
=>
T
)
:
Subscription
<
State
,
T
>
Type parameters
T
Parameters
query:
(
db
:
DB
<
State
>
)
=>
T
(
db
:
DB
<
State
>
)
:
T
Parameters
db:
DB
<
State
>
Returns
T
Returns
Subscription
<
State
,
T
>
query
query<Key>
(
type
:
Key
)
:
Query
<
State
,
Key
,
RowType
<
State
,
Key
>
>
Type parameters
Key
:
RowKeyOf
<
State
>
Parameters
type:
Key
Returns
Query
<
State
,
Key
,
RowType
<
State
,
Key
>
>
Private
read
State
read
State
(
state
:
State
)
:
void
Parameters
state:
State
Returns
void
reset
reset
(
type
?:
"all"
|
"tables"
|
"settings"
)
:
void
Parameters
Default value
type:
"all"
|
"tables"
|
"settings"
= "all"
Returns
void
revert
revert<K>
(
table
?:
K
, ids
?:
RowIdentififying
)
:
void
Type parameters
K
:
RowKeyOf
<
State
>
Parameters
Optional
table:
K
Optional
ids:
RowIdentififying
Returns
void
set
set<K, U>
(
name
:
K
, value
:
U
)
:
void
Type parameters
K
:
SettingsKey
<
State
>
U
:
SettingsType
<
State
,
K
>
Parameters
name:
K
value:
U
Returns
void
subscribe
subscribe
(
callback
:
(
action
:
DBAction
)
=>
void
)
:
(
)
=>
void
Parameters
callback:
(
action
:
DBAction
)
=>
void
(
action
:
DBAction
)
:
void
Parameters
action:
DBAction
Returns
void
Returns
(
)
=>
void
(
)
:
void
Returns
void
table
table<K>
(
type
:
K
)
:
MutableTable
<
RowType
<
State
,
K
>
>
Type parameters
K
:
RowKeyOf
<
State
>
Parameters
type:
K
Returns
MutableTable
<
RowType
<
State
,
K
>
>
transaction
transaction
(
execute
:
(
db
:
DB
<
State
>
, dispatch
:
DBDispatch
)
=>
void
)
:
void
Parameters
execute:
(
db
:
DB
<
State
>
, dispatch
:
DBDispatch
)
=>
void
(
db
:
DB
<
State
>
, dispatch
:
DBDispatch
)
:
void
Parameters
db:
DB
<
State
>
dispatch:
DBDispatch
Returns
void
Returns
void
truncate
truncate
(
)
:
void
Returns
void
Generated using
TypeDoc