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.
9 lines
344 B
9 lines
344 B
import { denormalize } from 'src/utils/normalization'
|
|
import { AppState, Post, EntityType } from 'src/types'
|
|
|
|
export const getUserPosts = (state: AppState, id: string) => {
|
|
const entityList = state.lists[`posts:${id}`]
|
|
if (!entityList) return []
|
|
|
|
return denormalize(entityList.entities, EntityType.Post, state.entities) as Post[]
|
|
}
|