2023-09-16 03:47:11 -07:00
|
|
|
import { useAppSelector } from './useAppSelector';
|
2022-09-14 11:01:00 -07:00
|
|
|
|
|
|
|
import type { ReducerCompose } from 'soapbox/reducers/compose';
|
|
|
|
|
|
|
|
/** Get compose for given key with fallback to 'default' */
|
2024-05-12 16:18:04 -07:00
|
|
|
export const useCompose = <ID extends string>(composeId: ID extends 'default' ? never : ID): ReturnType<typeof ReducerCompose> =>
|
|
|
|
useAppSelector((state) => state.compose.get(composeId, state.compose.get('default')!));
|