20.6.10 • Published 9 days ago

@stenajs-webui/redux v20.6.10

Weekly downloads
190
License
MIT
Repository
github
Last release
9 days ago

stenajs-webui/redux

This package contains utilities that can help create Redux features.

Higher order reducers

reducerIdGate

Creates a reducer that requires action.reducerId to match specified reducerId.

recordObjectReducer

Creates a reducer that applies the inner reducer to a state[action.recordId] instead of directly to state.

Reducer factories

commit-reducer

This reducer keeps a workspace state and a committed state. Changes can be made to workspace, which can then be committed.

entity-by-id-reducer

This reducer stores entities by id. Entities can be added, removed and updated.

entity-reducer

This reducer stores a single entity. It can be replaced and partially updated.

entity-list-reducer

This reducer stores a list and provides actions for manipulating the items in the list.

entity-crud-status-reducer

This reducer uses entity-by-id-reducer to store information about current CRUD operation state. It contains flags such as loading, error, etc.

modified-field-reducer

This reducer uses entity-by-id-reducer to store information about a change made to something. For example, if a user enters data into fields in a form, you can keep track of the changes made by the users to batch all updates.

selected-ids-reducer

This reducer contains a list of ids that can be toggled on or off. This can be used when having a list of checkboxes that can be toggled on or off.

sort-order-by-id-reducer

This reducer keeps track of a sort order where the order is determined by a list of ids. This is useful when different lists sort the same entity, but does not have access to the same fields.

sort-order-reducer

This reducer keeps track of sort order by key, such as column name.

Usage

Here is an example.

commit-reducer

This makes it easy to have a state split into workspace and committed state.

This can be useful when editing a form, which uses workspace state. When user presses enter, it is committed.

A search query is built from committed state, and thus, the search is triggered when the commit occurs, instead of on every keystroke.

Reducer

export const timeTableFilterReducer =
  createCommitReducer<TimeTableFilterState>("timeTableFilter",
  {
    workspace: INITIAL_STATE,
    committed: INITIAL_STATE
  });
  • First argument is the id of the reducer. (You can have multiple)
  • Second argument is initial state, which must be { workspace: X, committed: Y }.
  • X can be the same as Y, but it is not required.

Actions

export const { setValues, commitValues, clearValues } =
  createCommitReducerActions<TimeTableFilterState>("timeTableFilter");

// In component
const dispatch = useDispatch();
dispatch(setValues({ email: "user@example.com" }));
  • The first argument is the id of the reducer.

Selectors

export const { getWorkspaceValues, getCommittedValues } = createCommitReducerSelectors<
  StoreState,
  TimeTableFilterState
>("timeTableFilter", state => state.timeTableFilter);

// In component
const filterValues = useSelector(getWorkspaceValues);
  • First argument is the id of the reducer.
  • Second argument is a selector which selects the reducers state from global store state.
20.6.10

9 days ago

20.6.9

10 days ago

20.6.8

20 days ago

20.6.7

20 days ago

20.6.6

20 days ago

20.6.5

21 days ago

20.6.4

27 days ago

20.6.3

1 month ago

20.6.2

1 month ago

20.6.1

2 months ago

20.5.5

2 months ago

20.6.0

2 months ago

20.5.4

2 months ago

20.5.3

2 months ago

20.5.2

3 months ago

20.5.1

3 months ago

20.4.3

3 months ago

20.4.2

3 months ago

20.5.0

3 months ago

20.4.1

3 months ago

20.3.1

3 months ago

20.3.0

3 months ago

20.4.0

3 months ago

20.2.0

3 months ago

20.0.3

3 months ago

20.1.0

3 months ago

20.0.1

3 months ago

20.0.2

3 months ago

19.0.5

4 months ago

20.0.0

3 months ago

19.0.3

4 months ago

19.0.4

4 months ago

19.0.2

4 months ago

19.0.1

4 months ago

19.0.0

4 months ago

19.0.0-next.76

5 months ago

19.0.0-next.75

5 months ago

19.0.0-next.74

5 months ago

19.0.0-next.73

5 months ago

19.0.0-next.72

5 months ago

19.0.0-next.71

5 months ago

19.0.0-next.69

5 months ago

19.0.0-next.70

5 months ago

19.0.0-next.68

5 months ago

19.0.0-next.59

6 months ago

19.0.0-next.58

6 months ago

19.0.0-next.57

6 months ago

19.0.0-next.56

6 months ago

19.0.0-next.55

6 months ago

19.0.0-next.54

6 months ago

19.0.0-next.53

6 months ago

19.0.0-next.52

6 months ago

19.0.0-next.51

6 months ago

19.0.0-next.50

6 months ago

19.0.0-next.67

5 months ago

19.0.0-next.66

5 months ago

19.0.0-next.65

5 months ago

19.0.0-next.64

6 months ago

19.0.0-next.63

6 months ago

19.0.0-next.62

6 months ago

19.0.0-next.61

6 months ago

19.0.0-next.60

6 months ago

19.0.0-next.38

6 months ago

18.9.3

8 months ago

19.0.0-next.37

6 months ago

18.9.2

8 months ago

19.0.0-next.36

7 months ago

18.9.1

8 months ago

19.0.0-next.35

7 months ago

18.9.0

8 months ago

19.0.0-next.34

7 months ago

19.0.0-next.33

7 months ago

19.0.0-next.32

7 months ago

19.0.0-next.31

7 months ago

19.0.0-next.30

7 months ago

18.10.0

8 months ago

18.10.1

8 months ago

19.0.0-next.29

7 months ago

19.0.0-next.28

7 months ago

19.0.0-next.49

6 months ago

19.0.0-next.48

6 months ago

19.0.0-next.47

6 months ago

19.0.0-next.46

6 months ago

19.0.0-next.45

6 months ago

19.0.0-next.44

6 months ago

19.0.0-next.43

6 months ago

19.0.0-next.42

6 months ago

19.0.0-next.41

6 months ago

19.0.0-next.40

6 months ago

19.0.0-next.39

6 months ago

19.0.0-next.16

7 months ago

19.0.0-next.15

7 months ago

19.0.0-next.14

7 months ago

19.0.0-next.13

7 months ago

19.0.0-next.12

7 months ago

18.8.0

8 months ago

19.0.0-next.11

7 months ago

18.11.0

8 months ago

18.11.1

8 months ago

19.0.0-next.27

7 months ago

19.0.0-next.26

7 months ago

19.0.0-next.25

7 months ago

19.0.0-next.24

7 months ago

19.0.0-next.23

7 months ago

19.0.0-next.22

7 months ago

19.0.0-next.21

7 months ago

19.0.0-next.20

7 months ago

19.0.0-next.1

8 months ago

19.0.0-next.0

8 months ago

19.0.0-next.9

7 months ago

19.0.0-next.8

7 months ago

19.0.0-next.7

7 months ago

19.0.0-next.6

7 months ago

19.0.0-next.5

7 months ago

19.0.0-next.19

7 months ago

19.0.0-next.4

7 months ago

19.0.0-next.18

7 months ago

19.0.0-next.3

7 months ago

19.0.0-next.17

7 months ago

19.0.0-next.2

8 months ago

18.7.2

8 months ago

18.12.0

8 months ago

18.12.1

7 months ago

18.12.2

6 months ago

18.12.3

6 months ago

18.11.2-next.0

8 months ago

18.12.1-next.0

8 months ago

18.7.1

11 months ago

18.7.0

11 months ago

18.6.1

12 months ago

18.6.0

1 year ago

18.5.0

1 year ago

18.4.2

1 year ago

18.4.1

1 year ago

18.2.0

1 year ago

18.1.2

1 year ago

18.1.1

1 year ago

18.1.0

1 year ago

18.0.3

1 year ago

18.0.2

1 year ago

18.4.0

1 year ago

18.3.0

1 year ago

18.0.1

1 year ago

18.0.0

1 year ago

17.31.0

1 year ago

17.32.0

1 year ago

17.30.7

1 year ago

17.33.0

1 year ago

17.34.0

1 year ago

17.29.0

1 year ago

17.29.1

1 year ago

17.30.0

1 year ago

17.30.4

1 year ago

17.30.3

1 year ago

17.30.2

1 year ago

17.30.1

1 year ago

17.30.6

1 year ago

17.30.5

1 year ago

17.28.0

1 year ago

17.28.1

1 year ago

17.20.0

2 years ago

17.21.0

2 years ago

17.26.0

2 years ago

17.27.1

1 year ago

17.27.0

1 year ago

17.24.0

2 years ago

17.25.0

2 years ago

17.22.0

2 years ago

17.19.0

2 years ago

17.19.1

2 years ago

17.23.1

2 years ago

17.23.0

2 years ago

17.16.0

2 years ago

17.17.0

2 years ago

17.13.0

2 years ago

17.13.1

2 years ago

17.13.2

2 years ago

17.13.3

2 years ago

17.18.3

2 years ago

17.18.0

2 years ago

17.18.1

2 years ago

17.18.2

2 years ago

17.14.0

2 years ago

17.15.0

2 years ago

17.12.1

2 years ago

17.12.0

2 years ago

15.7.0

2 years ago

17.3.0

2 years ago

17.7.0

2 years ago

16.1.0

2 years ago

17.4.1

2 years ago

17.4.0

2 years ago

17.0.0

2 years ago

17.8.0

2 years ago

17.10.0

2 years ago

17.10.1

2 years ago

17.1.2

2 years ago

17.1.1

2 years ago

17.5.0

2 years ago

17.1.0

2 years ago

17.9.0

2 years ago

17.11.0

2 years ago

17.2.0

2 years ago

17.6.0

2 years ago

16.0.0

2 years ago

15.5.8

2 years ago

15.5.7

2 years ago

15.5.9

2 years ago

15.6.0

2 years ago

15.5.10

2 years ago

15.4.1

2 years ago

15.4.0

2 years ago

15.5.0

2 years ago

15.5.2

2 years ago

15.5.1

2 years ago

15.5.4

2 years ago

15.5.3

2 years ago

15.5.6

2 years ago

15.5.5

2 years ago

15.3.2

2 years ago

15.3.1

2 years ago

15.3.0

2 years ago

15.2.0

2 years ago

15.2.1

2 years ago

15.0.0-alpha.9

2 years ago

15.0.0-alpha.8

2 years ago

15.0.2

2 years ago

15.0.3

2 years ago

15.0.0

2 years ago

15.0.1

2 years ago

15.0.0-alpha.10

2 years ago

15.1.0

2 years ago

15.0.0-alpha.7

2 years ago

15.0.0-alpha.6

2 years ago

15.0.0-alpha.5

2 years ago

14.2.0

2 years ago

15.0.0-alpha.4

2 years ago

15.0.0-alpha.3

2 years ago

15.0.0-alpha.2

2 years ago

15.0.0-alpha.1

2 years ago

15.0.0-alpha.0

2 years ago

14.1.1

3 years ago

14.1.0

3 years ago

14.0.1

3 years ago

14.0.2

3 years ago

14.0.0

3 years ago

13.4.0

3 years ago

13.3.0

3 years ago

13.2.0

3 years ago

13.1.1

3 years ago

13.1.2

3 years ago

13.1.0

3 years ago

13.0.6

3 years ago

13.0.7

3 years ago

13.0.5

3 years ago

13.0.4

3 years ago

13.0.2

3 years ago

13.0.3

3 years ago

13.0.0

3 years ago

13.0.1

3 years ago

12.0.0

3 years ago

11.3.1

3 years ago

11.3.0

3 years ago

11.2.0

3 years ago

11.1.0

3 years ago

11.0.0

3 years ago

10.1.1

3 years ago

10.1.2

3 years ago

10.1.0

3 years ago

10.0.0

3 years ago

9.1.3

3 years ago

9.1.2

3 years ago

9.1.1

3 years ago

9.1.0

3 years ago

9.0.0

3 years ago

8.1.0

3 years ago

8.0.1

3 years ago

8.0.3

3 years ago

8.0.2

3 years ago

7.5.2

3 years ago

7.5.1

3 years ago

7.5.0

3 years ago

8.0.0

3 years ago

7.4.0

3 years ago

7.3.0

3 years ago

7.2.1

3 years ago

7.2.0

3 years ago

7.1.0

3 years ago

7.0.0

3 years ago

6.1.0

3 years ago

6.0.1

3 years ago

6.0.0

3 years ago

5.3.2

3 years ago

5.3.1

3 years ago

5.3.0

3 years ago

5.2.0

3 years ago

5.0.0

3 years ago

4.1.0

3 years ago

4.0.1

3 years ago

4.0.2

3 years ago

4.0.0

3 years ago

3.0.0

3 years ago

2.3.1

3 years ago

2.3.0

3 years ago

2.2.0

4 years ago

2.1.0

4 years ago

2.0.9

4 years ago

2.0.8

4 years ago

2.0.7

4 years ago

2.0.6

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.0.0-beta.3

4 years ago

1.0.0-beta.2

4 years ago

1.0.0-beta.1

4 years ago

1.0.0-beta.0

4 years ago

1.0.0-alpha.2

4 years ago

1.0.0-alpha.0

4 years ago

0.0.51

4 years ago

0.0.50

4 years ago

0.0.49

4 years ago

0.0.48

4 years ago

0.0.47

4 years ago

0.0.46

4 years ago

0.0.45

4 years ago

0.0.44

5 years ago

0.0.43

5 years ago

0.0.42

5 years ago

0.0.41

5 years ago

0.0.40

5 years ago

0.0.39

5 years ago

0.0.38

5 years ago

0.0.37

5 years ago

0.0.36

5 years ago

0.0.35

5 years ago

0.0.34

5 years ago

0.0.33

5 years ago