myheritage / redux-selector-action

MIT License
11 stars 0 forks source link

fix: support extendable placeholder without extending it #6

Closed perilevy closed 4 years ago

perilevy commented 4 years ago

Today if I create an object placeholder this way: getPlaceholder({a: 1}) I can pass another object as an arg to extend it {b: 2} But I can't use it without extending it.

example:

const action = createSelectorAction(
    getPlaceholder({a: 1}),
    ({a, b = 2}) => {}
);

action({b: 2}); // supported
action(); // not supported

With this fix:

action(); // supported