mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
16 lines
489 B
JavaScript
16 lines
489 B
JavaScript
import { createSelector } from 'reselect';
|
|
import { findCommand, isCommandExecuting } from 'Utilities/Command';
|
|
import createCommandsSelector from './createCommandsSelector';
|
|
|
|
function createCommandExecutingSelector(name, contraints = {}) {
|
|
return createSelector(
|
|
createCommandsSelector(),
|
|
(commands) => {
|
|
const command = findCommand(commands, { name, ...contraints });
|
|
return isCommandExecuting(command);
|
|
}
|
|
);
|
|
}
|
|
|
|
export default createCommandExecutingSelector;
|