mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-20 22:14:34 -04:00
12 lines
392 B
TypeScript
12 lines
392 B
TypeScript
import { createSelector } from 'reselect';
|
|
import { findCommand } from 'Utilities/Command';
|
|
import createCommandsSelector from './createCommandsSelector';
|
|
|
|
function createCommandSelector(name: string, contraints = {}) {
|
|
return createSelector(createCommandsSelector(), (commands) => {
|
|
return findCommand(commands, { name, ...contraints });
|
|
});
|
|
}
|
|
|
|
export default createCommandSelector;
|