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

Commit 05bef70

Browse files
committed
Merge branch 'master' of github.com:davidkpiano/react-redux-form
2 parents d92830e + a18e163 commit 05bef70

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

react-redux-form.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,22 @@ export interface ControlProps<T> extends React.HTMLProps<T> {
209209
* Signifies that the field state (validation, etc.) should not persist when the component is unmounted. Default: false
210210
*/
211211
persist?: boolean;
212+
/**
213+
* The disabled prop works just like you'd expect for controls that support the HTML5 disabled attribute.
214+
*/
215+
disabled?: any;
216+
/**
217+
* The event(s) that you want the <Control> to ignore. This can be good for performance and/or for de-cluttering the console log.
218+
*/
219+
ignore?: string|string[];
220+
/**
221+
* Determines the value given the event (from onChange) and optionally the control component's props.
222+
*/
223+
getValue?: (e: Event, props: any) => any;
224+
/**
225+
* Signifies that the control is a toggle (e.g., a checkbox or a radio). If true, then some optimizations are made.
226+
*/
227+
isToggle?: boolean;
212228
}
213229

214230
export class Control<T> extends React.Component<ControlProps<T>, {}> {

src/actions/model-actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function createModelActions(s = defaultStrategies) {
7474
const valueWithoutItem = value.filter((_item) => !iteratee(_item));
7575

7676
return (s.length(value) === s.length(valueWithoutItem))
77-
? [...value, item]
77+
? s.push(value, item)
7878
: valueWithoutItem;
7979
}, s.array, 3);
8080

test/actions-spec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,22 @@ describe('model action creators', () => {
6565

6666
fn(dispatch, getState);
6767
});
68+
69+
it('should change a collection by pushing an item to it via symmetric difference', done => {
70+
const fn = actions.xor('foo.bar', 4);
71+
const dispatch = action => {
72+
done(assert.deepEqual(
73+
action.value,
74+
[1, 2, 3, 4]));
75+
};
76+
const getState = () => ({
77+
foo: {
78+
bar: [1, 2, 3],
79+
},
80+
});
81+
82+
fn(dispatch, getState);
83+
});
6884
});
6985

7086
describe('actions.push() thunk', () => {

0 commit comments

Comments
 (0)