-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert Feed page store js files to ts
- Loading branch information
1 parent
b006c02
commit c51c54e
Showing
3 changed files
with
68 additions
and
23 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,25 +1,54 @@ | ||
// @ts-nocheck | ||
// TODO(nkang) - convert to TS | ||
import { FeedFilter } from 'models/FeedFilter' | ||
import { ID } from 'models/Identifiers' | ||
|
||
export const FETCH_SUGGESTED_FOLLOW_USERS = 'FEED/FETCH_SUGGESTED_FOLLOW_USERS' | ||
export const FOLLOW_USERS = 'FEED/FOLLOW_USERS' | ||
export const SET_SUGGESTED_FOLLOWS = 'FEED/SET_SUGGESTED_FOLLOWS' | ||
export const SET_FEED_FILTER = 'FEED/SET_FEED_FILTER' | ||
|
||
export const fetchSuggestedFollowUsers = () => ({ | ||
type: FETCH_SUGGESTED_FOLLOW_USERS | ||
}) | ||
export type FetchSuggestedFollowUsersAction = { | ||
type: typeof FETCH_SUGGESTED_FOLLOW_USERS | ||
} | ||
|
||
export type FollowUsersAction = { | ||
type: typeof FOLLOW_USERS | ||
userIds: ID[] | ||
} | ||
|
||
export type SetSuggestedFollowsAction = { | ||
type: typeof SET_SUGGESTED_FOLLOWS | ||
userIds: ID[] | ||
} | ||
|
||
export type SetFeedFilterAction = { | ||
type: typeof SET_FEED_FILTER | ||
filter: FeedFilter | ||
} | ||
|
||
export type FeedPageActions = | ||
| FetchSuggestedFollowUsersAction | ||
| FollowUsersAction | ||
| SetSuggestedFollowsAction | ||
| SetFeedFilterAction | ||
|
||
export const fetchSuggestedFollowUsers = | ||
(): FetchSuggestedFollowUsersAction => ({ | ||
type: FETCH_SUGGESTED_FOLLOW_USERS | ||
}) | ||
|
||
export const followUsers = (userIds) => ({ | ||
export const followUsers = (userIds: ID[]): FollowUsersAction => ({ | ||
type: FOLLOW_USERS, | ||
userIds | ||
}) | ||
|
||
export const setSuggestedFollows = (userIds) => ({ | ||
export const setSuggestedFollows = ( | ||
userIds: ID[] | ||
): SetSuggestedFollowsAction => ({ | ||
type: SET_SUGGESTED_FOLLOWS, | ||
userIds | ||
}) | ||
|
||
export const setFeedFilter = (filter) => ({ | ||
export const setFeedFilter = (filter: FeedFilter): SetFeedFilterAction => ({ | ||
type: SET_FEED_FILTER, | ||
filter | ||
}) |
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
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