UNPKG

scrabble-solver

Version:

Scrabble Solver 2 - Free, open-source, cross-platform, multi-language analysis tool for Scrabble, Scrabble Duel, Super Scrabble, Letter League, Crossplay, Literaki, and Kelimelik. Quickly find the top-scoring words using the given board and tiles.

17 lines (10 loc) 716 B
import { createSelector } from '@reduxjs/toolkit'; import { isError } from '@scrabble-solver/types'; import type { RootState } from '../types'; export const selectDictionary = (state: RootState) => state.dictionary; export const selectDictionaryInput = createSelector([selectDictionary], (dictionary) => dictionary.input); export const selectDictionaryResults = createSelector([selectDictionary], (dictionary) => dictionary.results); export const selectDictionaryIsLoading = createSelector([selectDictionary], (dictionary) => dictionary.isLoading); export const selectDictionaryError = createSelector([selectDictionary], (dictionary) => { return isError(dictionary.error) ? dictionary.error : undefined; });