forked from zulip/zulip-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnullObjects.js
66 lines (57 loc) · 1.73 KB
/
nullObjects.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
54
55
56
57
58
59
60
61
62
63
64
65
66
/* @flow strict-local */
import type { User, Subscription, CaughtUp, Fetching, NavigationState } from './types';
export const nullFunction = () => {};
export const NULL_OBJECT = Object.freeze({});
export const NULL_ARRAY = Object.freeze([]);
/*
* All the below objects are DEPRECATED; rather than using one, choose the
* appropriate fallback behavior explicitly. See 25125db94 for more
* discussion, and 25125db94^..e22596c24 for a variety of examples of how.
*
* Further changes to eliminate the remaining uses of these would be great.
*/
/** DEPRECATED; don't add new uses. See block comment above definition. */
export const NULL_USER: User = {
avatar_url: '',
email: '',
full_name: '',
is_admin: false,
is_bot: false,
timezone: '',
user_id: -1,
};
/** DEPRECATED; don't add new uses. See block comment above definition. */
export const NULL_SUBSCRIPTION: Subscription = {
audible_notifications: false,
color: 'gray',
description: '',
desktop_notifications: false,
email_address: '',
in_home_view: false,
invite_only: false,
name: '',
pin_to_top: false,
stream_id: 0,
stream_weekly_traffic: 0,
push_notifications: false,
is_old_stream: false,
is_announcement_only: false,
history_public_to_subscribers: false,
};
/** DEPRECATED; don't add new uses. See block comment above definition. */
export const NULL_CAUGHTUP: CaughtUp = {
older: false,
newer: false,
};
/** DEPRECATED; don't add new uses. See block comment above definition. */
export const NULL_FETCHING: Fetching = {
older: false,
newer: false,
};
/** DEPRECATED; don't add new uses. See block comment above definition. */
export const NULL_NAV_STATE: NavigationState = {
index: -1,
isTransitioning: false,
key: '',
routes: [],
};