-
-
Save OliverJAsh/713183a57a6e70f06f41bfb0943d1615 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// actions.ts | |
import { ofType, unionize, UnionOf } from 'unionize'; | |
import { GalleryItem } from './types'; | |
export type SearchAction = { query: string }; | |
export const Action = unionize( | |
{ | |
Search: ofType<SearchAction>(), | |
SearchFailure: ofType<{}>(), | |
SearchSuccess: ofType<{ items: GalleryItem[] }>(), | |
}, | |
// Tag must be `type` to conform to expected Redux action type. | |
{ tag: 'type' }, | |
); | |
export type Action = UnionOf<typeof Action>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment