-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
entry-rn.js
54 lines (48 loc) · 1.84 KB
/
entry-rn.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
/* eslint-disable import/no-unresolved */
import Meteor, { Mongo } from '@socialize/react-native-meteor';
import { BaseModel } from '@socialize/base-model';
import { LinkableModel, LinkParent } from '@socialize/linkable-model';
import { User } from '@socialize/user-model';
import { ServerTime } from '@socialize/server-time';
/* eslint-enable import/no-unresolved */
import extendUser from './conversation-model/common/user-extensions.js';
import ConversationCollectionConstruct from './conversation-model/common/conversation-collection.js';
import ParticipantCollectionConstruct from './participant-model/common/participant-collection.js';
import MessageCollectionConstruct from './message-model/common/message-collection.js';
import ConversationConstruct from './conversation-model/common/conversation-model.js';
import ParticipantConstruct from './participant-model/common/participant-model.js';
import MessageConstruct from './message-model/common/message-model.js';
const ConversationsCollection = ConversationCollectionConstruct({ Mongo });
const ParticipantsCollection = ParticipantCollectionConstruct({ Mongo });
const MessagesCollection = MessageCollectionConstruct({ Mongo });
extendUser({ Meteor, User, ParticipantsCollection, ConversationsCollection });
const Participant = ParticipantConstruct({
Meteor,
BaseModel,
ServerTime,
ParticipantsCollection,
ConversationsCollection,
});
const Message = MessageConstruct({
Meteor,
LinkableModel,
LinkParent,
ServerTime,
MessagesCollection,
});
const Conversation = ConversationConstruct({
Meteor,
BaseModel,
User,
ServerTime,
ConversationsCollection,
Participant,
ParticipantsCollection,
Message,
MessagesCollection,
});
export {
Conversation, ConversationsCollection,
Participant, ParticipantsCollection,
Message, MessagesCollection,
};