You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
872 B
13 lines
872 B
import { denormalize } from 'src/utils/normalization'
|
|
import { AppState, EntityType, App, Installation } from 'src/types'
|
|
|
|
export const getApps = (state: AppState) => denormalize(state.apps.items, EntityType.App, state.entities) as App[]
|
|
export const getCreatedApps = (state: AppState) => denormalize(state.apps.created.items, EntityType.App, state.entities) as App[]
|
|
export const getInstallations = (state: AppState) => denormalize(state.composer.installations, EntityType.Installation, state.entities) as Installation[]
|
|
export const getError = (state: AppState) => state.composer.error
|
|
export const getHeight = (state: AppState) => state.composer.height
|
|
|
|
export const getSelectedInstallation = (state: AppState) => {
|
|
if (!state.composer.selected) return
|
|
return denormalize([state.composer.selected], EntityType.Installation, state.entities)[0] as Installation
|
|
}
|