@stenajs-webui/redux 17.6.0 → 17.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/common/ActionWithReducerId.d.ts +3 -3
- package/dist/common/EntityWithId.d.ts +3 -3
- package/dist/common/util/field-matcher.d.ts +1 -1
- package/dist/features/higher-order-reducers/entity-list-reducer/entity-list-action-creators.d.ts +17 -17
- package/dist/features/higher-order-reducers/entity-list-reducer/entity-list-actions.d.ts +52 -52
- package/dist/features/higher-order-reducers/entity-list-reducer/entity-list-reducer.d.ts +4 -4
- package/dist/features/higher-order-reducers/entity-list-reducer/entity-list-selectors.d.ts +6 -6
- package/dist/features/higher-order-reducers/record-object-reducer/record-object-action-creators.d.ts +7 -7
- package/dist/features/higher-order-reducers/record-object-reducer/record-object-actions.d.ts +17 -17
- package/dist/features/higher-order-reducers/record-object-reducer/record-object-reducer.d.ts +4 -4
- package/dist/features/higher-order-reducers/reducer-id-gate/reducer-id-action-wrapper.d.ts +12 -12
- package/dist/features/higher-order-reducers/reducer-id-gate/reducer-id-gate.d.ts +9 -9
- package/dist/features/reducer-factories/commit-reducer/commit-action-creators.d.ts +7 -7
- package/dist/features/reducer-factories/commit-reducer/commit-actions.d.ts +18 -18
- package/dist/features/reducer-factories/commit-reducer/commit-reducer.d.ts +3 -3
- package/dist/features/reducer-factories/commit-reducer/commit-selectors.d.ts +7 -7
- package/dist/features/reducer-factories/commit-reducer/commit-state.d.ts +4 -4
- package/dist/features/reducer-factories/editable-entity-reducer/editable-entity-action-creators.d.ts +11 -11
- package/dist/features/reducer-factories/editable-entity-reducer/editable-entity-actions.d.ts +27 -27
- package/dist/features/reducer-factories/editable-entity-reducer/editable-entity-reducer.d.ts +8 -8
- package/dist/features/reducer-factories/entity-by-id-reducer/entity-by-id-action-creators.d.ts +9 -9
- package/dist/features/reducer-factories/entity-by-id-reducer/entity-by-id-actions.d.ts +18 -18
- package/dist/features/reducer-factories/entity-by-id-reducer/entity-by-id-reducer.d.ts +11 -11
- package/dist/features/reducer-factories/entity-by-id-reducer/entity-by-id-selectors.d.ts +7 -7
- package/dist/features/reducer-factories/entity-crud-status-reducer/entity-crud-status-redux.d.ts +31 -31
- package/dist/features/reducer-factories/entity-reducer/entity-action-creators.d.ts +6 -6
- package/dist/features/reducer-factories/entity-reducer/entity-actions.d.ts +9 -9
- package/dist/features/reducer-factories/entity-reducer/entity-reducer.d.ts +4 -4
- package/dist/features/reducer-factories/entity-reducer/entity-selectors.d.ts +6 -6
- package/dist/features/reducer-factories/modified-field-reducer/modified-field-redux.d.ts +23 -23
- package/dist/features/reducer-factories/selected-ids-reducer/selected-ids-action-creators.d.ts +7 -7
- package/dist/features/reducer-factories/selected-ids-reducer/selected-ids-actions.d.ts +8 -8
- package/dist/features/reducer-factories/selected-ids-reducer/selected-ids-reducer.d.ts +9 -9
- package/dist/features/reducer-factories/selected-ids-reducer/selected-ids-selectors.d.ts +6 -6
- package/dist/features/reducer-factories/sort-order-by-id-reducer/hooks/use-sort-order-by-id.d.ts +3 -3
- package/dist/features/reducer-factories/sort-order-by-id-reducer/sort-order-by-id-action-creators.d.ts +7 -7
- package/dist/features/reducer-factories/sort-order-by-id-reducer/sort-order-by-id-actions.d.ts +8 -8
- package/dist/features/reducer-factories/sort-order-by-id-reducer/sort-order-by-id-reducer.d.ts +6 -6
- package/dist/features/reducer-factories/sort-order-by-id-reducer/sort-order-by-id-selectors.d.ts +8 -8
- package/dist/features/reducer-factories/sort-order-reducer/sort-order-action-creators.d.ts +6 -6
- package/dist/features/reducer-factories/sort-order-reducer/sort-order-actions.d.ts +9 -9
- package/dist/features/reducer-factories/sort-order-reducer/sort-order-reducer.d.ts +9 -9
- package/dist/features/reducer-factories/sort-order-reducer/sort-order-selectors.d.ts +6 -6
- package/dist/features/reducer-factories/value-by-id-reducer/value-by-id-action-creators.d.ts +7 -7
- package/dist/features/reducer-factories/value-by-id-reducer/value-by-id-actions.d.ts +13 -13
- package/dist/features/reducer-factories/value-by-id-reducer/value-by-id-reducer.d.ts +10 -10
- package/dist/features/reducer-factories/value-by-id-reducer/value-by-id-selectors.d.ts +6 -6
- package/dist/index.d.ts +44 -44
- package/dist/index.es.js +634 -656
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -722
- package/dist/index.js.map +1 -1
- package/package.json +5 -6
- package/dist/common/util/__tests__/field-matcher.test.d.ts +0 -1
- package/dist/features/higher-order-reducers/entity-list-reducer/__tests__/entity-list-reducer.test.d.ts +0 -1
- package/dist/features/higher-order-reducers/record-object-reducer/__tests__/record-object-reducer.test.d.ts +0 -1
- package/dist/features/higher-order-reducers/reducer-id-gate/__tests__/reducer-id-gate.test.d.ts +0 -1
- package/dist/features/reducer-factories/entity-by-id-reducer/__tests__/entity-by-id-reducer.test.d.ts +0 -1
- package/dist/features/reducer-factories/entity-reducer/__tests__/entity-reducer.test.d.ts +0 -1
- package/dist/features/reducer-factories/selected-ids-reducer/__tests__/selected-ids-reducer.test.d.ts +0 -1
- package/dist/features/reducer-factories/sort-order-by-id-reducer/__tests__/sort-order-by-id-reducer.test.d.ts +0 -1
- package/dist/features/reducer-factories/sort-order-reducer/__tests__/sort-order-reducer.test.d.ts +0 -1
- package/dist/features/reducer-factories/value-by-id-reducer/__tests__/value-by-id-reducer.test.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# v17.7.0 (Fri Jul 01 2022)
|
|
2
|
+
|
|
3
|
+
#### 🚀 Enhancement
|
|
4
|
+
|
|
5
|
+
- Build packages with vite [#475](https://github.com/StenaIT/stenajs-webui/pull/475) ([@lindskogen](https://github.com/lindskogen))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Johan Lindskogen ([@lindskogen](https://github.com/lindskogen))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v17.0.0 (Fri Jun 17 2022)
|
|
2
14
|
|
|
3
15
|
#### 💥 Breaking Change
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export interface ActionWithReducerId {
|
|
2
|
-
reducerId: string;
|
|
3
|
-
}
|
|
1
|
+
export interface ActionWithReducerId {
|
|
2
|
+
reducerId: string;
|
|
3
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export interface EntityWithId {
|
|
2
|
-
id: string;
|
|
3
|
-
}
|
|
1
|
+
export interface EntityWithId {
|
|
2
|
+
id: string;
|
|
3
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const fieldsMatch: <T>(entity: T, fields: Partial<T>) => boolean;
|
|
1
|
+
export declare const fieldsMatch: <T>(entity: T, fields: Partial<T>) => boolean;
|
package/dist/features/higher-order-reducers/entity-list-reducer/entity-list-action-creators.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { EntityListActionByFieldsMatchAction, EntityListActionByIndexAction, EntityListActionOnAllAction, EntityListAddAtEndAction, EntityListAddAtStartAction, EntityListClearListAction, EntityListRemoveAction, EntityListRemoveAtIndexAction, EntityListRemoveByFieldMatchAction, EntityListRemoveFirstAction, EntityListRemoveLastAction, EntityListSetListAction, EntityListToggleAction } from "./entity-list-actions";
|
|
2
|
-
export interface EntityListActions<T, TInnerAction> {
|
|
3
|
-
addAtEnd: (entity: T) => EntityListAddAtEndAction<T>;
|
|
4
|
-
addAtStart: (entity: T) => EntityListAddAtStartAction<T>;
|
|
5
|
-
clearList: () => EntityListClearListAction;
|
|
6
|
-
removeFirst: () => EntityListRemoveFirstAction;
|
|
7
|
-
removeLast: () => EntityListRemoveLastAction;
|
|
8
|
-
removeAtIndex: (index: number) => EntityListRemoveAtIndexAction;
|
|
9
|
-
removeByFieldMatch: (fields: Partial<T>) => EntityListRemoveByFieldMatchAction<T>;
|
|
10
|
-
remove: (entity: T) => EntityListRemoveAction<T>;
|
|
11
|
-
setList: (list: Array<T>) => EntityListSetListAction<T>;
|
|
12
|
-
toggle: (entity: T) => EntityListToggleAction<T>;
|
|
13
|
-
actionByFieldsMatch: (fields: Partial<T>, action: TInnerAction) => EntityListActionByFieldsMatchAction<T, TInnerAction>;
|
|
14
|
-
actionByIndex: (index: number, action: TInnerAction) => EntityListActionByIndexAction<TInnerAction>;
|
|
15
|
-
actionOnAll: (action: TInnerAction) => EntityListActionOnAllAction<TInnerAction>;
|
|
16
|
-
}
|
|
17
|
-
export declare const createEntityListActions: <T, TInnerAction = unknown>() => EntityListActions<T, TInnerAction>;
|
|
1
|
+
import { EntityListActionByFieldsMatchAction, EntityListActionByIndexAction, EntityListActionOnAllAction, EntityListAddAtEndAction, EntityListAddAtStartAction, EntityListClearListAction, EntityListRemoveAction, EntityListRemoveAtIndexAction, EntityListRemoveByFieldMatchAction, EntityListRemoveFirstAction, EntityListRemoveLastAction, EntityListSetListAction, EntityListToggleAction } from "./entity-list-actions";
|
|
2
|
+
export interface EntityListActions<T, TInnerAction> {
|
|
3
|
+
addAtEnd: (entity: T) => EntityListAddAtEndAction<T>;
|
|
4
|
+
addAtStart: (entity: T) => EntityListAddAtStartAction<T>;
|
|
5
|
+
clearList: () => EntityListClearListAction;
|
|
6
|
+
removeFirst: () => EntityListRemoveFirstAction;
|
|
7
|
+
removeLast: () => EntityListRemoveLastAction;
|
|
8
|
+
removeAtIndex: (index: number) => EntityListRemoveAtIndexAction;
|
|
9
|
+
removeByFieldMatch: (fields: Partial<T>) => EntityListRemoveByFieldMatchAction<T>;
|
|
10
|
+
remove: (entity: T) => EntityListRemoveAction<T>;
|
|
11
|
+
setList: (list: Array<T>) => EntityListSetListAction<T>;
|
|
12
|
+
toggle: (entity: T) => EntityListToggleAction<T>;
|
|
13
|
+
actionByFieldsMatch: (fields: Partial<T>, action: TInnerAction) => EntityListActionByFieldsMatchAction<T, TInnerAction>;
|
|
14
|
+
actionByIndex: (index: number, action: TInnerAction) => EntityListActionByIndexAction<TInnerAction>;
|
|
15
|
+
actionOnAll: (action: TInnerAction) => EntityListActionOnAllAction<TInnerAction>;
|
|
16
|
+
}
|
|
17
|
+
export declare const createEntityListActions: <T, TInnerAction = unknown>() => EntityListActions<T, TInnerAction>;
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
export declare type EntityListAction<T, TInnerAction> = EntityListSetListAction<T> | EntityListAddAtEndAction<T> | EntityListAddAtStartAction<T> | EntityListClearListAction | EntityListRemoveFirstAction | EntityListRemoveLastAction | EntityListRemoveAtIndexAction | EntityListRemoveByFieldMatchAction<T> | EntityListRemoveAction<T> | EntityListToggleAction<T> | EntityListActionByFieldsMatchAction<T, TInnerAction> | EntityListActionByIndexAction<TInnerAction> | EntityListActionOnAllAction<TInnerAction>;
|
|
2
|
-
export interface EntityListSetListAction<T> {
|
|
3
|
-
type: "ENTITY_LIST:SET_LIST";
|
|
4
|
-
list: Array<T>;
|
|
5
|
-
}
|
|
6
|
-
export interface EntityListClearListAction {
|
|
7
|
-
type: "ENTITY_LIST:CLEAR_LIST";
|
|
8
|
-
}
|
|
9
|
-
export interface EntityListAddAtEndAction<T> {
|
|
10
|
-
type: "ENTITY_LIST:ADD_AT_END";
|
|
11
|
-
entity: T;
|
|
12
|
-
}
|
|
13
|
-
export interface EntityListAddAtStartAction<T> {
|
|
14
|
-
type: "ENTITY_LIST:ADD_AT_START";
|
|
15
|
-
entity: T;
|
|
16
|
-
}
|
|
17
|
-
export interface EntityListRemoveFirstAction {
|
|
18
|
-
type: "ENTITY_LIST:REMOVE_FIRST";
|
|
19
|
-
}
|
|
20
|
-
export interface EntityListRemoveLastAction {
|
|
21
|
-
type: "ENTITY_LIST:REMOVE_LAST";
|
|
22
|
-
}
|
|
23
|
-
export interface EntityListRemoveAtIndexAction {
|
|
24
|
-
type: "ENTITY_LIST:REMOVE_AT_INDEX";
|
|
25
|
-
index: number;
|
|
26
|
-
}
|
|
27
|
-
export interface EntityListRemoveByFieldMatchAction<T> {
|
|
28
|
-
type: "ENTITY_LIST:REMOVE_BY_FIELD_MATCH";
|
|
29
|
-
fields: Partial<T>;
|
|
30
|
-
}
|
|
31
|
-
export interface EntityListRemoveAction<T> {
|
|
32
|
-
type: "ENTITY_LIST:REMOVE";
|
|
33
|
-
entity: T;
|
|
34
|
-
}
|
|
35
|
-
export interface EntityListToggleAction<T> {
|
|
36
|
-
type: "ENTITY_LIST:TOGGLE";
|
|
37
|
-
entity: T;
|
|
38
|
-
}
|
|
39
|
-
export interface EntityListActionByFieldsMatchAction<T, TInnerAction> {
|
|
40
|
-
type: "ENTITY_LIST:ACTION_BY_FIELDS_MATCH";
|
|
41
|
-
fields: Partial<T>;
|
|
42
|
-
action: TInnerAction;
|
|
43
|
-
}
|
|
44
|
-
export interface EntityListActionByIndexAction<TInnerAction> {
|
|
45
|
-
type: "ENTITY_LIST:ACTION_BY_INDEX";
|
|
46
|
-
index: number;
|
|
47
|
-
action: TInnerAction;
|
|
48
|
-
}
|
|
49
|
-
export interface EntityListActionOnAllAction<TInnerAction> {
|
|
50
|
-
type: "ENTITY_LIST:ACTION_ON_ALL";
|
|
51
|
-
action: TInnerAction;
|
|
52
|
-
}
|
|
1
|
+
export declare type EntityListAction<T, TInnerAction> = EntityListSetListAction<T> | EntityListAddAtEndAction<T> | EntityListAddAtStartAction<T> | EntityListClearListAction | EntityListRemoveFirstAction | EntityListRemoveLastAction | EntityListRemoveAtIndexAction | EntityListRemoveByFieldMatchAction<T> | EntityListRemoveAction<T> | EntityListToggleAction<T> | EntityListActionByFieldsMatchAction<T, TInnerAction> | EntityListActionByIndexAction<TInnerAction> | EntityListActionOnAllAction<TInnerAction>;
|
|
2
|
+
export interface EntityListSetListAction<T> {
|
|
3
|
+
type: "ENTITY_LIST:SET_LIST";
|
|
4
|
+
list: Array<T>;
|
|
5
|
+
}
|
|
6
|
+
export interface EntityListClearListAction {
|
|
7
|
+
type: "ENTITY_LIST:CLEAR_LIST";
|
|
8
|
+
}
|
|
9
|
+
export interface EntityListAddAtEndAction<T> {
|
|
10
|
+
type: "ENTITY_LIST:ADD_AT_END";
|
|
11
|
+
entity: T;
|
|
12
|
+
}
|
|
13
|
+
export interface EntityListAddAtStartAction<T> {
|
|
14
|
+
type: "ENTITY_LIST:ADD_AT_START";
|
|
15
|
+
entity: T;
|
|
16
|
+
}
|
|
17
|
+
export interface EntityListRemoveFirstAction {
|
|
18
|
+
type: "ENTITY_LIST:REMOVE_FIRST";
|
|
19
|
+
}
|
|
20
|
+
export interface EntityListRemoveLastAction {
|
|
21
|
+
type: "ENTITY_LIST:REMOVE_LAST";
|
|
22
|
+
}
|
|
23
|
+
export interface EntityListRemoveAtIndexAction {
|
|
24
|
+
type: "ENTITY_LIST:REMOVE_AT_INDEX";
|
|
25
|
+
index: number;
|
|
26
|
+
}
|
|
27
|
+
export interface EntityListRemoveByFieldMatchAction<T> {
|
|
28
|
+
type: "ENTITY_LIST:REMOVE_BY_FIELD_MATCH";
|
|
29
|
+
fields: Partial<T>;
|
|
30
|
+
}
|
|
31
|
+
export interface EntityListRemoveAction<T> {
|
|
32
|
+
type: "ENTITY_LIST:REMOVE";
|
|
33
|
+
entity: T;
|
|
34
|
+
}
|
|
35
|
+
export interface EntityListToggleAction<T> {
|
|
36
|
+
type: "ENTITY_LIST:TOGGLE";
|
|
37
|
+
entity: T;
|
|
38
|
+
}
|
|
39
|
+
export interface EntityListActionByFieldsMatchAction<T, TInnerAction> {
|
|
40
|
+
type: "ENTITY_LIST:ACTION_BY_FIELDS_MATCH";
|
|
41
|
+
fields: Partial<T>;
|
|
42
|
+
action: TInnerAction;
|
|
43
|
+
}
|
|
44
|
+
export interface EntityListActionByIndexAction<TInnerAction> {
|
|
45
|
+
type: "ENTITY_LIST:ACTION_BY_INDEX";
|
|
46
|
+
index: number;
|
|
47
|
+
action: TInnerAction;
|
|
48
|
+
}
|
|
49
|
+
export interface EntityListActionOnAllAction<TInnerAction> {
|
|
50
|
+
type: "ENTITY_LIST:ACTION_ON_ALL";
|
|
51
|
+
action: TInnerAction;
|
|
52
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EntityListAction } from "./entity-list-actions";
|
|
2
|
-
import { Action, AnyAction, Reducer } from "redux";
|
|
3
|
-
export declare type EntityListState<TListItem> = Array<TListItem>;
|
|
4
|
-
export declare const createEntityListReducer: <TListItem, TListItemAction extends Action<any> = AnyAction>(reducer?: Reducer<TListItem, TListItemAction> | undefined) => (state: EntityListState<TListItem> | undefined, action: EntityListAction<TListItem, TListItemAction>) => EntityListState<TListItem>;
|
|
1
|
+
import { EntityListAction } from "./entity-list-actions";
|
|
2
|
+
import { Action, AnyAction, Reducer } from "redux";
|
|
3
|
+
export declare type EntityListState<TListItem> = Array<TListItem>;
|
|
4
|
+
export declare const createEntityListReducer: <TListItem, TListItemAction extends Action<any> = AnyAction>(reducer?: Reducer<TListItem, TListItemAction> | undefined) => (state: EntityListState<TListItem> | undefined, action: EntityListAction<TListItem, TListItemAction>) => EntityListState<TListItem>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EntityListState } from "./entity-list-reducer";
|
|
2
|
-
export interface EntityListSelectors<TStoreState, TEntity> {
|
|
3
|
-
getList: (store: TStoreState) => Array<TEntity>;
|
|
4
|
-
}
|
|
5
|
-
export declare type EntityListSelector<TStoreState, TEntity> = (state: TStoreState) => EntityListState<TEntity>;
|
|
6
|
-
export declare const createEntityListSelectors: <TStoreState, TEntity>(stateSelector: EntityListSelector<TStoreState, TEntity>) => EntityListSelectors<TStoreState, TEntity>;
|
|
1
|
+
import { EntityListState } from "./entity-list-reducer";
|
|
2
|
+
export interface EntityListSelectors<TStoreState, TEntity> {
|
|
3
|
+
getList: (store: TStoreState) => Array<TEntity>;
|
|
4
|
+
}
|
|
5
|
+
export declare type EntityListSelector<TStoreState, TEntity> = (state: TStoreState) => EntityListState<TEntity>;
|
|
6
|
+
export declare const createEntityListSelectors: <TStoreState, TEntity>(stateSelector: EntityListSelector<TStoreState, TEntity>) => EntityListSelectors<TStoreState, TEntity>;
|
package/dist/features/higher-order-reducers/record-object-reducer/record-object-action-creators.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { RecordObjectClearAllRecordsAction, RecordObjectClearRecordAction, RecordObjectRecordAction, RecordObjectKey, RecordObjectWrappedAction } from "./record-object-actions";
|
|
2
|
-
export interface RecordObjectActions<TInnerAction extends RecordObjectWrappedAction> {
|
|
3
|
-
recordAction: (recordId: RecordObjectKey, action: TInnerAction) => RecordObjectRecordAction<TInnerAction>;
|
|
4
|
-
clearRecord: (recordId: RecordObjectKey) => RecordObjectClearRecordAction;
|
|
5
|
-
clearAllRecords: () => RecordObjectClearAllRecordsAction;
|
|
6
|
-
}
|
|
7
|
-
export declare const createRecordObjectActions: <TInnerAction extends RecordObjectWrappedAction>() => RecordObjectActions<TInnerAction>;
|
|
1
|
+
import { RecordObjectClearAllRecordsAction, RecordObjectClearRecordAction, RecordObjectRecordAction, RecordObjectKey, RecordObjectWrappedAction } from "./record-object-actions";
|
|
2
|
+
export interface RecordObjectActions<TInnerAction extends RecordObjectWrappedAction> {
|
|
3
|
+
recordAction: (recordId: RecordObjectKey, action: TInnerAction) => RecordObjectRecordAction<TInnerAction>;
|
|
4
|
+
clearRecord: (recordId: RecordObjectKey) => RecordObjectClearRecordAction;
|
|
5
|
+
clearAllRecords: () => RecordObjectClearAllRecordsAction;
|
|
6
|
+
}
|
|
7
|
+
export declare const createRecordObjectActions: <TInnerAction extends RecordObjectWrappedAction>() => RecordObjectActions<TInnerAction>;
|
package/dist/features/higher-order-reducers/record-object-reducer/record-object-actions.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export interface RecordObjectWrappedAction {
|
|
2
|
-
type: string;
|
|
3
|
-
}
|
|
4
|
-
export declare type RecordObjectAction<TInnerAction extends RecordObjectWrappedAction> = RecordObjectClearRecordAction | RecordObjectClearAllRecordsAction | RecordObjectRecordAction<TInnerAction>;
|
|
5
|
-
export declare type RecordObjectKey = string | number;
|
|
6
|
-
export interface RecordObjectRecordAction<TInnerAction extends RecordObjectWrappedAction> {
|
|
7
|
-
type: "RECORD_OBJECT:ACTION";
|
|
8
|
-
recordId: RecordObjectKey;
|
|
9
|
-
action: TInnerAction;
|
|
10
|
-
}
|
|
11
|
-
export interface RecordObjectClearRecordAction {
|
|
12
|
-
type: "RECORD_OBJECT:CLEAR_RECORD";
|
|
13
|
-
recordId: RecordObjectKey;
|
|
14
|
-
}
|
|
15
|
-
export interface RecordObjectClearAllRecordsAction {
|
|
16
|
-
type: "RECORD_OBJECT:CLEAR_ALL_RECORDS";
|
|
17
|
-
}
|
|
1
|
+
export interface RecordObjectWrappedAction {
|
|
2
|
+
type: string;
|
|
3
|
+
}
|
|
4
|
+
export declare type RecordObjectAction<TInnerAction extends RecordObjectWrappedAction> = RecordObjectClearRecordAction | RecordObjectClearAllRecordsAction | RecordObjectRecordAction<TInnerAction>;
|
|
5
|
+
export declare type RecordObjectKey = string | number;
|
|
6
|
+
export interface RecordObjectRecordAction<TInnerAction extends RecordObjectWrappedAction> {
|
|
7
|
+
type: "RECORD_OBJECT:ACTION";
|
|
8
|
+
recordId: RecordObjectKey;
|
|
9
|
+
action: TInnerAction;
|
|
10
|
+
}
|
|
11
|
+
export interface RecordObjectClearRecordAction {
|
|
12
|
+
type: "RECORD_OBJECT:CLEAR_RECORD";
|
|
13
|
+
recordId: RecordObjectKey;
|
|
14
|
+
}
|
|
15
|
+
export interface RecordObjectClearAllRecordsAction {
|
|
16
|
+
type: "RECORD_OBJECT:CLEAR_ALL_RECORDS";
|
|
17
|
+
}
|
package/dist/features/higher-order-reducers/record-object-reducer/record-object-reducer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Reducer } from "redux";
|
|
2
|
-
import { RecordObjectAction, RecordObjectKey, RecordObjectWrappedAction } from "./record-object-actions";
|
|
3
|
-
export declare type RecordObjectState<TInnerState> = Record<RecordObjectKey, TInnerState>;
|
|
4
|
-
export declare const createRecordObjectReducer: <TInnerAction extends RecordObjectWrappedAction, TInnerState = unknown>(reducer: Reducer<TInnerState, TInnerAction>) => Reducer<RecordObjectState<TInnerState>, RecordObjectAction<TInnerAction>>;
|
|
1
|
+
import { Reducer } from "redux";
|
|
2
|
+
import { RecordObjectAction, RecordObjectKey, RecordObjectWrappedAction } from "./record-object-actions";
|
|
3
|
+
export declare type RecordObjectState<TInnerState> = Record<RecordObjectKey, TInnerState>;
|
|
4
|
+
export declare const createRecordObjectReducer: <TInnerAction extends RecordObjectWrappedAction, TInnerState = unknown>(reducer: Reducer<TInnerState, TInnerAction>) => Reducer<RecordObjectState<TInnerState>, RecordObjectAction<TInnerAction>>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ReducerIdGateAction } from "./reducer-id-gate";
|
|
2
|
-
declare type ActionCreator = (...args: any) => any;
|
|
3
|
-
export declare type ActionCreatorCreator<TActionCreator extends ActionCreator> = (...args: Parameters<TActionCreator>) => ReducerIdGateAction<ReturnType<TActionCreator>>;
|
|
4
|
-
export declare const wrapActionWithReducerIdGate: <TActionCreator extends ActionCreator>(reducerId: string, actionCreator: TActionCreator) => ActionCreatorCreator<TActionCreator>;
|
|
5
|
-
export interface ActionCreatorsMapObject {
|
|
6
|
-
[key: string]: ActionCreator;
|
|
7
|
-
}
|
|
8
|
-
export declare type ReducerIdGatedActionCreator<TActionCreators extends ActionCreatorsMapObject> = {
|
|
9
|
-
[K in keyof TActionCreators]: ActionCreatorCreator<TActionCreators[K]>;
|
|
10
|
-
};
|
|
11
|
-
export declare const wrapActionsWithReducerIdGate: <TActionCreators extends ActionCreatorsMapObject>(reducerId: string, actionCreators: TActionCreators) => ReducerIdGatedActionCreator<TActionCreators>;
|
|
12
|
-
export {};
|
|
1
|
+
import { ReducerIdGateAction } from "./reducer-id-gate";
|
|
2
|
+
declare type ActionCreator = (...args: any) => any;
|
|
3
|
+
export declare type ActionCreatorCreator<TActionCreator extends ActionCreator> = (...args: Parameters<TActionCreator>) => ReducerIdGateAction<ReturnType<TActionCreator>>;
|
|
4
|
+
export declare const wrapActionWithReducerIdGate: <TActionCreator extends ActionCreator>(reducerId: string, actionCreator: TActionCreator) => ActionCreatorCreator<TActionCreator>;
|
|
5
|
+
export interface ActionCreatorsMapObject {
|
|
6
|
+
[key: string]: ActionCreator;
|
|
7
|
+
}
|
|
8
|
+
export declare type ReducerIdGatedActionCreator<TActionCreators extends ActionCreatorsMapObject> = {
|
|
9
|
+
[K in keyof TActionCreators]: ActionCreatorCreator<TActionCreators[K]>;
|
|
10
|
+
};
|
|
11
|
+
export declare const wrapActionsWithReducerIdGate: <TActionCreators extends ActionCreatorsMapObject>(reducerId: string, actionCreators: TActionCreators) => ReducerIdGatedActionCreator<TActionCreators>;
|
|
12
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Action, AnyAction, Reducer } from "redux";
|
|
2
|
-
export interface ReducerIdGateAction<TInnerAction> {
|
|
3
|
-
type: "REDUCER_ID_GATE:ACTION";
|
|
4
|
-
reducerId: string;
|
|
5
|
-
action: TInnerAction;
|
|
6
|
-
}
|
|
7
|
-
export declare type ReducerIdGateReducer<TState, TInnerAction extends Action = AnyAction> = Reducer<TState, ReducerIdGateAction<TInnerAction>>;
|
|
8
|
-
export declare const reducerIdGate: <TState, TInnerAction extends Action<any> = AnyAction>(reducerId: string, reducer: Reducer<TState, TInnerAction>) => ReducerIdGateReducer<TState, TInnerAction>;
|
|
9
|
-
export declare const reducerIdGateAction: <TInnerAction>(reducerId: string, action: TInnerAction) => ReducerIdGateAction<TInnerAction>;
|
|
1
|
+
import { Action, AnyAction, Reducer } from "redux";
|
|
2
|
+
export interface ReducerIdGateAction<TInnerAction> {
|
|
3
|
+
type: "REDUCER_ID_GATE:ACTION";
|
|
4
|
+
reducerId: string;
|
|
5
|
+
action: TInnerAction;
|
|
6
|
+
}
|
|
7
|
+
export declare type ReducerIdGateReducer<TState, TInnerAction extends Action = AnyAction> = Reducer<TState, ReducerIdGateAction<TInnerAction>>;
|
|
8
|
+
export declare const reducerIdGate: <TState, TInnerAction extends Action<any> = AnyAction>(reducerId: string, reducer: Reducer<TState, TInnerAction>) => ReducerIdGateReducer<TState, TInnerAction>;
|
|
9
|
+
export declare const reducerIdGateAction: <TInnerAction>(reducerId: string, action: TInnerAction) => ReducerIdGateAction<TInnerAction>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ClearFilterValuesActionCreator, CommitFilterValuesActionCreator, SetFilterValuesActionCreator } from "./commit-actions";
|
|
2
|
-
export interface CommitReducerActions<TState> {
|
|
3
|
-
setValues: SetFilterValuesActionCreator<TState>;
|
|
4
|
-
commitValues: CommitFilterValuesActionCreator;
|
|
5
|
-
clearValues: ClearFilterValuesActionCreator;
|
|
6
|
-
}
|
|
7
|
-
export declare const createCommitReducerActions: <TState>(id: string) => CommitReducerActions<TState>;
|
|
1
|
+
import { ClearFilterValuesActionCreator, CommitFilterValuesActionCreator, SetFilterValuesActionCreator } from "./commit-actions";
|
|
2
|
+
export interface CommitReducerActions<TState> {
|
|
3
|
+
setValues: SetFilterValuesActionCreator<TState>;
|
|
4
|
+
commitValues: CommitFilterValuesActionCreator;
|
|
5
|
+
clearValues: ClearFilterValuesActionCreator;
|
|
6
|
+
}
|
|
7
|
+
export declare const createCommitReducerActions: <TState>(id: string) => CommitReducerActions<TState>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export declare type CommitReducerAction<TState> = SetValuesAction<TState> | CommitValuesAction | ClearValuesAction;
|
|
2
|
-
interface SetValuesAction<TState> {
|
|
3
|
-
type: "COMMIT_REDUCER.SET_VALUES";
|
|
4
|
-
id: string;
|
|
5
|
-
values: Partial<TState>;
|
|
6
|
-
}
|
|
7
|
-
interface CommitValuesAction {
|
|
8
|
-
type: "COMMIT_REDUCER.COMMIT_VALUES";
|
|
9
|
-
id: string;
|
|
10
|
-
}
|
|
11
|
-
interface ClearValuesAction {
|
|
12
|
-
type: "COMMIT_REDUCER.CLEAR";
|
|
13
|
-
id: string;
|
|
14
|
-
}
|
|
15
|
-
export declare type SetFilterValuesActionCreator<TState> = (values: Partial<TState>) => SetValuesAction<TState>;
|
|
16
|
-
export declare type CommitFilterValuesActionCreator = () => CommitValuesAction;
|
|
17
|
-
export declare type ClearFilterValuesActionCreator = () => ClearValuesAction;
|
|
18
|
-
export {};
|
|
1
|
+
export declare type CommitReducerAction<TState> = SetValuesAction<TState> | CommitValuesAction | ClearValuesAction;
|
|
2
|
+
interface SetValuesAction<TState> {
|
|
3
|
+
type: "COMMIT_REDUCER.SET_VALUES";
|
|
4
|
+
id: string;
|
|
5
|
+
values: Partial<TState>;
|
|
6
|
+
}
|
|
7
|
+
interface CommitValuesAction {
|
|
8
|
+
type: "COMMIT_REDUCER.COMMIT_VALUES";
|
|
9
|
+
id: string;
|
|
10
|
+
}
|
|
11
|
+
interface ClearValuesAction {
|
|
12
|
+
type: "COMMIT_REDUCER.CLEAR";
|
|
13
|
+
id: string;
|
|
14
|
+
}
|
|
15
|
+
export declare type SetFilterValuesActionCreator<TState> = (values: Partial<TState>) => SetValuesAction<TState>;
|
|
16
|
+
export declare type CommitFilterValuesActionCreator = () => CommitValuesAction;
|
|
17
|
+
export declare type ClearFilterValuesActionCreator = () => ClearValuesAction;
|
|
18
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { CommitReducerAction } from "./commit-actions";
|
|
2
|
-
import { CommitReducerState } from "./commit-state";
|
|
3
|
-
export declare const createCommitReducer: <TState>(id: string, initialState: CommitReducerState<TState>) => (state: CommitReducerState<TState> | undefined, action: CommitReducerAction<TState>) => CommitReducerState<TState>;
|
|
1
|
+
import { CommitReducerAction } from "./commit-actions";
|
|
2
|
+
import { CommitReducerState } from "./commit-state";
|
|
3
|
+
export declare const createCommitReducer: <TState>(id: string, initialState: CommitReducerState<TState>) => (state: CommitReducerState<TState> | undefined, action: CommitReducerAction<TState>) => CommitReducerState<TState>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CommitReducerState } from "./commit-state";
|
|
2
|
-
export declare type CommitReducerStateSelector<TStoreState, TState> = (state: TStoreState, id: string) => CommitReducerState<TState>;
|
|
3
|
-
export interface CommitReducerSelectors<TStoreState, TState> {
|
|
4
|
-
getWorkspaceValues: (state: TStoreState) => TState;
|
|
5
|
-
getCommittedValues: (state: TStoreState) => TState;
|
|
6
|
-
}
|
|
7
|
-
export declare const createCommitReducerSelectors: <TStoreState, TState>(id: string, stateSelector: CommitReducerStateSelector<TStoreState, TState>) => CommitReducerSelectors<TStoreState, TState>;
|
|
1
|
+
import { CommitReducerState } from "./commit-state";
|
|
2
|
+
export declare type CommitReducerStateSelector<TStoreState, TState> = (state: TStoreState, id: string) => CommitReducerState<TState>;
|
|
3
|
+
export interface CommitReducerSelectors<TStoreState, TState> {
|
|
4
|
+
getWorkspaceValues: (state: TStoreState) => TState;
|
|
5
|
+
getCommittedValues: (state: TStoreState) => TState;
|
|
6
|
+
}
|
|
7
|
+
export declare const createCommitReducerSelectors: <TStoreState, TState>(id: string, stateSelector: CommitReducerStateSelector<TStoreState, TState>) => CommitReducerSelectors<TStoreState, TState>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface CommitReducerState<TState> {
|
|
2
|
-
workspace: TState;
|
|
3
|
-
committed: TState;
|
|
4
|
-
}
|
|
1
|
+
export interface CommitReducerState<TState> {
|
|
2
|
+
workspace: TState;
|
|
3
|
+
committed: TState;
|
|
4
|
+
}
|
package/dist/features/reducer-factories/editable-entity-reducer/editable-entity-action-creators.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { EditableEntityCommitEditableEntityToPersistedAction, EditableEntityRevertEditableEntityAction, EditableEntitySetEditableEntityAction, EditableEntitySetEditableEntityFieldsAction, EditableEntitySetEntityAction, EditableEntitySetEntityIdAction, EditableEntitySetPersistedEntityAction } from "./editable-entity-actions";
|
|
2
|
-
export interface EditableEntityActions<T> {
|
|
3
|
-
setEntityId: (entityId: string | undefined) => EditableEntitySetEntityIdAction;
|
|
4
|
-
setEntity: (entity: T) => EditableEntitySetEntityAction<T>;
|
|
5
|
-
setPersistedEntity: (entity: T) => EditableEntitySetPersistedEntityAction<T>;
|
|
6
|
-
setEditableEntity: (entity: T) => EditableEntitySetEditableEntityAction<T>;
|
|
7
|
-
setEditableEntityFields: (fields: Partial<T>) => EditableEntitySetEditableEntityFieldsAction<T>;
|
|
8
|
-
revertEditableEntity: () => EditableEntityRevertEditableEntityAction;
|
|
9
|
-
commitEditableEntityToPersisted: () => EditableEntityCommitEditableEntityToPersistedAction;
|
|
10
|
-
}
|
|
11
|
-
export declare const createEditableEntityActions: <T>() => EditableEntityActions<T>;
|
|
1
|
+
import { EditableEntityCommitEditableEntityToPersistedAction, EditableEntityRevertEditableEntityAction, EditableEntitySetEditableEntityAction, EditableEntitySetEditableEntityFieldsAction, EditableEntitySetEntityAction, EditableEntitySetEntityIdAction, EditableEntitySetPersistedEntityAction } from "./editable-entity-actions";
|
|
2
|
+
export interface EditableEntityActions<T> {
|
|
3
|
+
setEntityId: (entityId: string | undefined) => EditableEntitySetEntityIdAction;
|
|
4
|
+
setEntity: (entity: T) => EditableEntitySetEntityAction<T>;
|
|
5
|
+
setPersistedEntity: (entity: T) => EditableEntitySetPersistedEntityAction<T>;
|
|
6
|
+
setEditableEntity: (entity: T) => EditableEntitySetEditableEntityAction<T>;
|
|
7
|
+
setEditableEntityFields: (fields: Partial<T>) => EditableEntitySetEditableEntityFieldsAction<T>;
|
|
8
|
+
revertEditableEntity: () => EditableEntityRevertEditableEntityAction;
|
|
9
|
+
commitEditableEntityToPersisted: () => EditableEntityCommitEditableEntityToPersistedAction;
|
|
10
|
+
}
|
|
11
|
+
export declare const createEditableEntityActions: <T>() => EditableEntityActions<T>;
|
package/dist/features/reducer-factories/editable-entity-reducer/editable-entity-actions.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
export declare type EditableEntityAction<T> = EditableEntitySetEntityAction<T> | EditableEntitySetPersistedEntityAction<T> | EditableEntitySetEditableEntityAction<T> | EditableEntitySetEntityIdAction | EditableEntitySetEditableEntityFieldsAction<T> | EditableEntityRevertEditableEntityAction | EditableEntityCommitEditableEntityToPersistedAction;
|
|
2
|
-
export interface EditableEntitySetEntityAction<T> {
|
|
3
|
-
type: "EDITABLE_ENTITY:SET_ENTITY";
|
|
4
|
-
entity: T;
|
|
5
|
-
}
|
|
6
|
-
export interface EditableEntitySetEntityIdAction {
|
|
7
|
-
type: "EDITABLE_ENTITY:SET_ENTITY_ID";
|
|
8
|
-
id: string | undefined;
|
|
9
|
-
}
|
|
10
|
-
export interface EditableEntitySetPersistedEntityAction<T> {
|
|
11
|
-
type: "EDITABLE_ENTITY:SET_PERSISTED_ENTITY";
|
|
12
|
-
entity: T;
|
|
13
|
-
}
|
|
14
|
-
export interface EditableEntitySetEditableEntityAction<T> {
|
|
15
|
-
type: "EDITABLE_ENTITY:SET_EDITABLE_ENTITY";
|
|
16
|
-
entity: T;
|
|
17
|
-
}
|
|
18
|
-
export interface EditableEntitySetEditableEntityFieldsAction<T> {
|
|
19
|
-
type: "EDITABLE_ENTITY:SET_EDITABLE_ENTITY_FIELDS";
|
|
20
|
-
fields: Partial<T>;
|
|
21
|
-
}
|
|
22
|
-
export interface EditableEntityRevertEditableEntityAction {
|
|
23
|
-
type: "EDITABLE_ENTITY:REVERT_EDITABLE_ENTITY";
|
|
24
|
-
}
|
|
25
|
-
export interface EditableEntityCommitEditableEntityToPersistedAction {
|
|
26
|
-
type: "EDITABLE_ENTITY:COMMIT_EDITABLE_ENTITY_TO_PERSISTED";
|
|
27
|
-
}
|
|
1
|
+
export declare type EditableEntityAction<T> = EditableEntitySetEntityAction<T> | EditableEntitySetPersistedEntityAction<T> | EditableEntitySetEditableEntityAction<T> | EditableEntitySetEntityIdAction | EditableEntitySetEditableEntityFieldsAction<T> | EditableEntityRevertEditableEntityAction | EditableEntityCommitEditableEntityToPersistedAction;
|
|
2
|
+
export interface EditableEntitySetEntityAction<T> {
|
|
3
|
+
type: "EDITABLE_ENTITY:SET_ENTITY";
|
|
4
|
+
entity: T;
|
|
5
|
+
}
|
|
6
|
+
export interface EditableEntitySetEntityIdAction {
|
|
7
|
+
type: "EDITABLE_ENTITY:SET_ENTITY_ID";
|
|
8
|
+
id: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
export interface EditableEntitySetPersistedEntityAction<T> {
|
|
11
|
+
type: "EDITABLE_ENTITY:SET_PERSISTED_ENTITY";
|
|
12
|
+
entity: T;
|
|
13
|
+
}
|
|
14
|
+
export interface EditableEntitySetEditableEntityAction<T> {
|
|
15
|
+
type: "EDITABLE_ENTITY:SET_EDITABLE_ENTITY";
|
|
16
|
+
entity: T;
|
|
17
|
+
}
|
|
18
|
+
export interface EditableEntitySetEditableEntityFieldsAction<T> {
|
|
19
|
+
type: "EDITABLE_ENTITY:SET_EDITABLE_ENTITY_FIELDS";
|
|
20
|
+
fields: Partial<T>;
|
|
21
|
+
}
|
|
22
|
+
export interface EditableEntityRevertEditableEntityAction {
|
|
23
|
+
type: "EDITABLE_ENTITY:REVERT_EDITABLE_ENTITY";
|
|
24
|
+
}
|
|
25
|
+
export interface EditableEntityCommitEditableEntityToPersistedAction {
|
|
26
|
+
type: "EDITABLE_ENTITY:COMMIT_EDITABLE_ENTITY_TO_PERSISTED";
|
|
27
|
+
}
|
package/dist/features/reducer-factories/editable-entity-reducer/editable-entity-reducer.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Reducer } from "redux";
|
|
2
|
-
import { EditableEntityAction } from "./editable-entity-actions";
|
|
3
|
-
export interface EditableEntityState<T> {
|
|
4
|
-
id?: string;
|
|
5
|
-
persisted: T;
|
|
6
|
-
editable: T;
|
|
7
|
-
}
|
|
8
|
-
export declare const createEditableEntityReducer: <T>(initialEntity: T, initialId?: string) => Reducer<EditableEntityState<T>, EditableEntityAction<T>>;
|
|
1
|
+
import { Reducer } from "redux";
|
|
2
|
+
import { EditableEntityAction } from "./editable-entity-actions";
|
|
3
|
+
export interface EditableEntityState<T> {
|
|
4
|
+
id?: string;
|
|
5
|
+
persisted: T;
|
|
6
|
+
editable: T;
|
|
7
|
+
}
|
|
8
|
+
export declare const createEditableEntityReducer: <T>(initialEntity: T, initialId?: string) => Reducer<EditableEntityState<T>, EditableEntityAction<T>>;
|
package/dist/features/reducer-factories/entity-by-id-reducer/entity-by-id-action-creators.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { EntityWithId } from "../../../common/EntityWithId";
|
|
2
|
-
import { EntityByIdClearAllEntitiesAction, EntityByIdClearEntityAction, EntityByIdSetEntityAction, EntityByIdSetEntityFieldsAction } from "./entity-by-id-actions";
|
|
3
|
-
export interface EntityByIdActions<T extends EntityWithId> {
|
|
4
|
-
setEntity: (entity: T) => EntityByIdSetEntityAction<T>;
|
|
5
|
-
setEntityFields: (id: string, fields: Partial<T>) => EntityByIdSetEntityFieldsAction<T>;
|
|
6
|
-
clearEntity: (id: string) => EntityByIdClearEntityAction;
|
|
7
|
-
clearAllEntities: () => EntityByIdClearAllEntitiesAction;
|
|
8
|
-
}
|
|
9
|
-
export declare const createEntityByIdActions: <T extends EntityWithId>() => EntityByIdActions<T>;
|
|
1
|
+
import { EntityWithId } from "../../../common/EntityWithId";
|
|
2
|
+
import { EntityByIdClearAllEntitiesAction, EntityByIdClearEntityAction, EntityByIdSetEntityAction, EntityByIdSetEntityFieldsAction } from "./entity-by-id-actions";
|
|
3
|
+
export interface EntityByIdActions<T extends EntityWithId> {
|
|
4
|
+
setEntity: (entity: T) => EntityByIdSetEntityAction<T>;
|
|
5
|
+
setEntityFields: (id: string, fields: Partial<T>) => EntityByIdSetEntityFieldsAction<T>;
|
|
6
|
+
clearEntity: (id: string) => EntityByIdClearEntityAction;
|
|
7
|
+
clearAllEntities: () => EntityByIdClearAllEntitiesAction;
|
|
8
|
+
}
|
|
9
|
+
export declare const createEntityByIdActions: <T extends EntityWithId>() => EntityByIdActions<T>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { EntityWithId } from "../../../common/EntityWithId";
|
|
2
|
-
export declare type EntityByIdAction<T extends EntityWithId> = EntityByIdSetEntityAction<T> | EntityByIdSetEntityFieldsAction<T> | EntityByIdClearEntityAction | EntityByIdClearAllEntitiesAction;
|
|
3
|
-
export interface EntityByIdSetEntityAction<T extends EntityWithId> {
|
|
4
|
-
type: "ENTITY_BY_ID:SET_ENTITY";
|
|
5
|
-
entity: T;
|
|
6
|
-
}
|
|
7
|
-
export interface EntityByIdSetEntityFieldsAction<T extends EntityWithId> {
|
|
8
|
-
type: "ENTITY_BY_ID:SET_ENTITY_FIELDS";
|
|
9
|
-
id: string;
|
|
10
|
-
fields: Partial<T>;
|
|
11
|
-
}
|
|
12
|
-
export interface EntityByIdClearEntityAction {
|
|
13
|
-
type: "ENTITY_BY_ID:CLEAR_ENTITY";
|
|
14
|
-
id: string;
|
|
15
|
-
}
|
|
16
|
-
export interface EntityByIdClearAllEntitiesAction {
|
|
17
|
-
type: "ENTITY_BY_ID:CLEAR_ALL_ENTITIES";
|
|
18
|
-
}
|
|
1
|
+
import { EntityWithId } from "../../../common/EntityWithId";
|
|
2
|
+
export declare type EntityByIdAction<T extends EntityWithId> = EntityByIdSetEntityAction<T> | EntityByIdSetEntityFieldsAction<T> | EntityByIdClearEntityAction | EntityByIdClearAllEntitiesAction;
|
|
3
|
+
export interface EntityByIdSetEntityAction<T extends EntityWithId> {
|
|
4
|
+
type: "ENTITY_BY_ID:SET_ENTITY";
|
|
5
|
+
entity: T;
|
|
6
|
+
}
|
|
7
|
+
export interface EntityByIdSetEntityFieldsAction<T extends EntityWithId> {
|
|
8
|
+
type: "ENTITY_BY_ID:SET_ENTITY_FIELDS";
|
|
9
|
+
id: string;
|
|
10
|
+
fields: Partial<T>;
|
|
11
|
+
}
|
|
12
|
+
export interface EntityByIdClearEntityAction {
|
|
13
|
+
type: "ENTITY_BY_ID:CLEAR_ENTITY";
|
|
14
|
+
id: string;
|
|
15
|
+
}
|
|
16
|
+
export interface EntityByIdClearAllEntitiesAction {
|
|
17
|
+
type: "ENTITY_BY_ID:CLEAR_ALL_ENTITIES";
|
|
18
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { EntityWithId } from "../../../common/EntityWithId";
|
|
2
|
-
import { EntityByIdAction } from "./entity-by-id-actions";
|
|
3
|
-
export interface EntityByIdState<T extends EntityWithId> {
|
|
4
|
-
entities: {
|
|
5
|
-
[key: string]: T;
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
export declare const entityByIdInitialState: {
|
|
9
|
-
entities: {};
|
|
10
|
-
};
|
|
11
|
-
export declare const createEntityByIdReducer: <T extends EntityWithId>() => (state: EntityByIdState<T> | undefined, action: EntityByIdAction<T>) => EntityByIdState<T>;
|
|
1
|
+
import { EntityWithId } from "../../../common/EntityWithId";
|
|
2
|
+
import { EntityByIdAction } from "./entity-by-id-actions";
|
|
3
|
+
export interface EntityByIdState<T extends EntityWithId> {
|
|
4
|
+
entities: {
|
|
5
|
+
[key: string]: T;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export declare const entityByIdInitialState: {
|
|
9
|
+
entities: {};
|
|
10
|
+
};
|
|
11
|
+
export declare const createEntityByIdReducer: <T extends EntityWithId>() => (state: EntityByIdState<T> | undefined, action: EntityByIdAction<T>) => EntityByIdState<T>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EntityWithId } from "../../../common/EntityWithId";
|
|
2
|
-
import { EntityByIdState } from "./entity-by-id-reducer";
|
|
3
|
-
export interface EntityByIdSelectors<TStoreState, TEntity extends EntityWithId> {
|
|
4
|
-
getState: EntityByIdStateSelector<TStoreState, TEntity>;
|
|
5
|
-
}
|
|
6
|
-
export declare type EntityByIdStateSelector<TStoreState, TEntity extends EntityWithId> = (state: TStoreState) => EntityByIdState<TEntity>;
|
|
7
|
-
export declare const createEntityByIdSelectors: <TStoreState, TEntity extends EntityWithId>(stateSelector: EntityByIdStateSelector<TStoreState, TEntity>) => EntityByIdSelectors<TStoreState, TEntity>;
|
|
1
|
+
import { EntityWithId } from "../../../common/EntityWithId";
|
|
2
|
+
import { EntityByIdState } from "./entity-by-id-reducer";
|
|
3
|
+
export interface EntityByIdSelectors<TStoreState, TEntity extends EntityWithId> {
|
|
4
|
+
getState: EntityByIdStateSelector<TStoreState, TEntity>;
|
|
5
|
+
}
|
|
6
|
+
export declare type EntityByIdStateSelector<TStoreState, TEntity extends EntityWithId> = (state: TStoreState) => EntityByIdState<TEntity>;
|
|
7
|
+
export declare const createEntityByIdSelectors: <TStoreState, TEntity extends EntityWithId>(stateSelector: EntityByIdStateSelector<TStoreState, TEntity>) => EntityByIdSelectors<TStoreState, TEntity>;
|