updux/src/utils.js

7 lines
219 B
JavaScript
Raw Normal View History

2022-08-30 14:09:24 +00:00
export const matches = (conditions) => (target) =>
Object.entries(conditions).every(([key, value]) =>
typeof value === 'function'
? value(target[key])
: target[key] === value,
);