This repository has been archived by the owner on Jan 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(actions-links): use promise-middleware, fix tests
feat(actions-links): use promise-middleware, fix tests
- Loading branch information
Showing
2 changed files
with
14 additions
and
29 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,11 @@ | ||
// @flow | ||
import {awral} from 'actions/utils' | ||
import {getLinksAPI} from 'api/LinksSvc' | ||
import type {LinkItem} from 'types' | ||
// Define action types | ||
export const GET_LINKS_SUCCESS = 'GET_LINKS_SUCCESS' | ||
export const GET_LINKS_FAIL = 'GET_LINKS_FAIL' | ||
export const GET_LINKS_FULFILLED = 'GET_LINKS_FULFILLED' | ||
export const GET_LINKS_REJECTED = 'GET_LINKS_REJECTED' | ||
export const GET_LINKS_PENDING = 'GET_LINKS_PENDING' | ||
|
||
export type GET_LINKS_SUCCESS_TYPE = { | ||
type: 'GET_LINKS_SUCCESS', | ||
payload: Array<LinkItem> | ||
} | ||
|
||
export type GET_LINKS_FAIL_TYPE = { | ||
type: 'GET_LINKS_FAIL', | ||
payload: { | ||
errors?: void | Object | ||
} | ||
} | ||
|
||
export type GET_LINKS_PENDING_TYPE = { | ||
type: 'GET_LINKS_PENDING' | ||
} | ||
|
||
export const GET_LINKS = awral(getLinksAPI)('GET_LINKS') | ||
export const GET_LINKS = () => ({ | ||
type: 'GET_LINKS', | ||
payload: getLinksAPI() | ||
}) |
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