Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@zackargyle
Created September 27, 2017 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zackargyle/69db451e56ea2fa1ebdfa88c426228c6 to your computer and use it in GitHub Desktop.
Save zackargyle/69db451e56ea2fa1ebdfa88c426228c6 to your computer and use it in GitHub Desktop.
type Props = {
match: { params: { username: string } },
resource: { fetching: boolean },
user: User,
};
export default withResource({
name: 'UserResource',
key: 'resource',
options: ({ match }: Props) => ({
field_set_key: 'profile',
username: match.params.username,
}),
mapState: (state: ReduxState, { match }: Props) => ({
user: getUsersByUserName(state)[match.params.username],
}),
})(ProfilePage);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment