Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit 5dcb843

Browse files
committed
Consolidating load and change with .silent option
1 parent ff7c958 commit 5dcb843

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/action-types.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const actionTypes = {
33
CHANGE: 'rrf/change',
44
FOCUS: 'rrf/focus',
55
RESET: 'rrf/reset',
6-
LOAD: 'rrf/load',
76
VALIDATE: 'rrf/validate',
87
SET_DIRTY: 'rrf/setDirty',
98
SET_ERRORS: 'rrf/setErrors',

src/actions/model-actions.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,8 @@ const merge = (model, values) => (dispatch, getState) => {
131131
});
132132
};
133133

134-
const load = (model, values) => ({
135-
type: actionTypes.LOAD,
136-
model,
137-
value: values,
134+
const load = (model, values) => change(model, values, {
135+
silent: true,
138136
});
139137

140138
export default {

src/reducers/form-reducer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ function _createFormReducer(model, initialState) {
152152
});
153153

154154
case actionTypes.CHANGE: {
155+
if (action.silent) return state;
156+
155157
const setDirtyState = icepick.merge(state, {
156158
dirty: true, // will be deprecated
157159
pristine: false,

0 commit comments

Comments
 (0)