mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
Convert store selectors to Typescript
This commit is contained in:
11
frontend/src/Store/Selectors/createCommandSelector.ts
Normal file
11
frontend/src/Store/Selectors/createCommandSelector.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
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;
|
Reference in New Issue
Block a user