updux/src/utils.js

7 lines
219 B
JavaScript

export const matches = (conditions) => (target) =>
Object.entries(conditions).every(([key, value]) =>
typeof value === 'function'
? value(target[key])
: target[key] === value,
);