22 lines
513 B
TypeScript
22 lines
513 B
TypeScript
|
import { AppState } from 'features/reducers';
|
||
|
|
||
|
function getNodes(state: AppState) {
|
||
|
return state.config.nodes;
|
||
|
}
|
||
|
|
||
|
export function getSelectedNode(state: AppState) {
|
||
|
return getNodes(state).selectedNode;
|
||
|
}
|
||
|
|
||
|
export function getPreviouslySelectedNode(state: AppState) {
|
||
|
return getSelectedNode(state).prevNode;
|
||
|
}
|
||
|
|
||
|
export function isNodeChanging(state: AppState): boolean {
|
||
|
return getSelectedNode(state).pending;
|
||
|
}
|
||
|
|
||
|
export function getNodeId(state: AppState): string {
|
||
|
return getSelectedNode(state).nodeId;
|
||
|
}
|