All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ducks.overlays.selectors.ts Maven / Gradle / Ivy

There is a newer version: 7.28.2
Show newest version
import { createSelector } from '@reduxjs/toolkit'

import { State } from '../State'

/**
 * селектор модольных окон
 */
export const overlaysSelector = (state: State) => state.overlays || []

/**
 * Получение оверлей по имени
 */
const makeOverlayByName = (name: string) => createSelector([overlaysSelector], overlaysState => overlaysState.find(overlay => overlay.name === name))

/**
 * Получение showPrompt по имени
 */
export const makeShowPromptByName = (name: string) => createSelector(
    makeOverlayByName(name),
    overlay => Boolean(overlay?.showPrompt),
)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy