forked from keybase/client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
people-gen.js
53 lines (48 loc) · 2.3 KB
/
people-gen.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// @flow
// NOTE: This file is GENERATED from json files in actions/json. Run 'yarn build-actions' to regenerate
/* eslint-disable no-unused-vars,prettier/prettier */
import * as I from 'immutable'
import * as RPCTypes from '../constants/types/rpc-gen'
import * as More from '../constants/types/more'
import * as Types from '../constants/types/people'
// Constants
export const resetStore = 'common:resetStore' // not a part of people but is handled by every reducer
export const getPeopleData = 'people:getPeopleData'
export const markViewed = 'people:markViewed'
export const peopleDataProcessed = 'people:peopleDataProcessed'
export const setupPeopleHandlers = 'people:setupPeopleHandlers'
export const skipTodo = 'people:skipTodo'
// Action Creators
export const createGetPeopleData = (
payload: $ReadOnly<{|
markViewed: boolean,
numFollowSuggestionsWanted: number,
|}>
) => ({error: false, payload, type: getPeopleData})
export const createMarkViewed = () => ({error: false, payload: undefined, type: markViewed})
export const createPeopleDataProcessed = (
payload: $ReadOnly<{|
oldItems: I.List<Types.PeopleScreenItem>,
newItems: I.List<Types.PeopleScreenItem>,
followSuggestions: I.List<Types.FollowSuggestion>,
lastViewed: Date,
version: number,
|}>
) => ({error: false, payload, type: peopleDataProcessed})
export const createSetupPeopleHandlers = () => ({error: false, payload: undefined, type: setupPeopleHandlers})
export const createSkipTodo = (payload: $ReadOnly<{|type: Types.TodoType|}>) => ({error: false, payload, type: skipTodo})
// Action Payloads
export type GetPeopleDataPayload = More.ReturnType<typeof createGetPeopleData>
export type MarkViewedPayload = More.ReturnType<typeof createMarkViewed>
export type PeopleDataProcessedPayload = More.ReturnType<typeof createPeopleDataProcessed>
export type SetupPeopleHandlersPayload = More.ReturnType<typeof createSetupPeopleHandlers>
export type SkipTodoPayload = More.ReturnType<typeof createSkipTodo>
// All Actions
// prettier-ignore
export type Actions =
| More.ReturnType<typeof createGetPeopleData>
| More.ReturnType<typeof createMarkViewed>
| More.ReturnType<typeof createPeopleDataProcessed>
| More.ReturnType<typeof createSetupPeopleHandlers>
| More.ReturnType<typeof createSkipTodo>
| {type: 'common:resetStore', payload: void}