Fixed: Updates to commandExecutingSelector

This commit is contained in:
Qstick 2018-09-04 22:40:26 -04:00
parent 68aaa49e9f
commit e41f884153
16 changed files with 57 additions and 73 deletions

View file

@ -1,12 +1,11 @@
import { createSelector } from 'reselect';
import { findCommand, isCommandExecuting } from 'Utilities/Command';
import createCommandsSelector from './createCommandsSelector';
import { isCommandExecuting } from 'Utilities/Command';
import createCommandSelector from './createCommandSelector';
function createCommandExecutingSelector(name, contraints = {}) {
return createSelector(
createCommandsSelector(),
(commands) => {
const command = findCommand(commands, { name, ...contraints });
createCommandSelector(name, contraints),
(command) => {
return isCommandExecuting(command);
}
);

View file

@ -6,7 +6,7 @@ function createCommandSelector(name, contraints = {}) {
return createSelector(
createCommandsSelector(),
(commands) => {
return !!findCommand(commands, { name, ...contraints });
return findCommand(commands, { name, ...contraints });
}
);
}