diff --git a/doc/Chat-Streams-overview.graphml b/doc/Chat-Streams-overview.graphml new file mode 100644 index 0000000..6d5f4e2 --- /dev/null +++ b/doc/Chat-Streams-overview.graphml @@ -0,0 +1,1674 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + ThreadsService constructor(MessagesService) + + + + + + + + + + Folder 2 + + + + + + + + + + + + + + + + currentThread + + + + + + + + + + + + + + + + threads<map of threads> +set messagesThread.lastMessage + + + + + + + + + + + + + + + + orderedThreads<Thread[]> + + + + + + + + + + + + + + + + currentThreadMessages + + + + + + + + + + + + + + + + map + + + + + + + + + + + + + + + + + + + + + + shareReplay + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + map + + + + + + + + + + + + + + + + + + + + + + shareReplay + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + setCurrentThread + + + + + + + + + + + + + + + + + combineLatest + + + + + + + + + + + + + + + + + + + + + + shareReplay + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + MessagesService constructor + + + + + + + + + + Folder 1 + + + + + + + + + + + + + + + + newMessages + + + + + + + + + + + + + + + + filter + + + + + + + + + + + + + + + + + + + + + + messagesForThreadUser + + + + + + + + + + + + + + + + thread,user + + + + + + + + + + + + + + + + + create + + + + + + + + + + + + + + + + updates + + + + + + + + + + + + + + + + scan + + + + + + + + + + + + + + + + + + + + + + shareReplay + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + messages + + + + + + + + + + + + + + + + addMessage + + + + + + + + + + + + + + + + + map + + + + + + + + + + + + + + + + + + + + + + markThreadAsRead + + + + + + + + + + + + + + + + map + + + + + + + + + + + + + + + + + + + + + + + + + + + UserService + + + + + + + + + + Folder 3 + + + + + + + + + + + + + + + + currentUser + + + + + + + + + + + + + + + + setCurrentUser + + + + + + + + + + + + + + + + + + + ChatThread.clicked() + + + + + + + + + + + + + + + + + ChatThread.selected + + + + + + + + + + + + + + + + + ChatThreads.threads + + + + + + + + + + + + + + + + + ChatWindow.messages + + + + + + + + + + + + + + + + + ChatWindow.currentThread + + + + + + + + + + + + + + + + + ChatWindow.currentUser + + + + + + + + + + + + + + + + + ChatWindow.sendMessage + + + + + + + + + + + + + + + + + ChatMessage.currentUser + + + + + + + + + + + + + + + + + + + + Legend + + + + + + + + + + Folder 4 + + + + + + + + + + + + + + + + Subject=Observable+Observer + + + + + + + + + + + + + + + + + Observable/Stream + + + + + + + + + + + + + + + + BehaviorSubject +(stores last value) + + + + + + + + + + + + + + + + Someone calls onNext or +this observable subscribes +itself to another observable + + + + + + + + + + + + + + + + from View component + + + + + + + + + + + + + + + + + + + + + + Bot + + + + + + + + + + Folder 5 + + + + + + + + + + + + + + + + forEach + + + + + + + + + + + + + + + + + + + + + + + + combineLatest + + + + + + + + + + + + + + + + + + + + + + ChatNavBar.unreadMessageCount + + + + + + + + + + + + + + + + + + Visualization of +Streams in Chat +Application +(ngbook-r10) + + + + + + + + + + + + + + + + + {id:threads[id]} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ordered Threads + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + onNext(newThread) + + + + + + + + + + + + + + + + + message + + + + + + + + + + + + + + + + + message + + + + + + + + + + + + + + + + + message if in given + thread and not user + + + + + + + + + + + + + + + + + + + + + + + + + + message + + + + + + + + + + + + + + + + + all actions + + + + + + + + + + + + + + + + + messages:Message[] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + onNext(message) + + + + + + + + + + + + + + + + + operation (adds one + message to messages) + + + + + + + + + + + + + + + + + thread + + + + + + + + + + + + + + + + + operation (mark all messages + of current thread as read) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + messages of + current thread + + + + + + + + + + + + + + + + + + + + + + + + + + onNext(newUser) + + + + + + + + + + + + + + + + + + + + + + + + + + imperative call + + + + + + + + + + + + + + + + + + + + subscribe + + + + + + + + + + + + + + + + + = + + + + + + + + + + + + + + + + + = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + imperative call + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + messages:Message[] + + + + + + + + + + + + + + + + + + + + + + = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/Chat-Streams-overview.pdf b/doc/Chat-Streams-overview.pdf new file mode 100644 index 0000000..6391506 Binary files /dev/null and b/doc/Chat-Streams-overview.pdf differ diff --git a/doc/ChatApp.graphml b/doc/ChatApp.graphml new file mode 100644 index 0000000..185dc07 --- /dev/null +++ b/doc/ChatApp.graphml @@ -0,0 +1,1287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + Services + + + + + + + + + + Folder 2 + + + + + + + + + + + + + + + + @Inj:UserService + <html> +currentUser: Subject<br> +setCurrentUser(user)<br> + + + + + + + + + + + + + + + + + + + @Inj:ThreadService + <html> +threads:Observable<br> +orderedThreads: Observable<br> +currentThread: Subject<br> +currentThreadMessages<br> +constructor()<br> +setCurrentThread(thread) + + + + + + + + + + + + + + + + + + + @Inj:MessageService + <html> +newMessages:Subject<br> +messages: Observable<br> +updates: Subject<br> +create: Subject (actionStream)<br> +markThreadAsRead: Subject (actionStream)<br> +constructor()<br> +addMessage(message)<br> +messagesForThreadUser(thread,user) + + + + + + + + + + + + + + + + + + + + + + + + Models + + + + + + + + + + Folder 3 + + + + + + + + + + + + + + + + Thread + <html> +constructor()<br> +id<br> +lastMessage:Message<br> +name<br> +avataSrc<br> + + + + + + + + + + + + + + + + + + + Message + <html> +constructor()<br> +id<br> +sentAt<br> +isRead<br> +author:User<br> +text<br> +thread:Thread<br> + + + + + + + + + + + + + + + + + + + User + <html> +constructor()<br> +id<br> +name<br> +avatarSrc + + + + + + + + + + + + + + + + + + + + + + + + + Components + + + + + + + + + + Folder 9 + + + + + + + + + + + + + + + + + + + ChatThread + + + + + + + + + + Folder 1 + + + + + + + + + + + + + + + + thread + + + + + + + + + + + + + + + + + <chat-thread> + + + + + + + + + + + ThreadService + + + + + + + + + + + + + + + + + ChatThread + <html> +threadsService:ThreadService<br> +thread:Thread<br> +selected: boolean<br> +constructor()<br> +onInit()<br> +clicked()<br> + + + + + + + + + + + + + + + + + + + + + + + + ChatMessage + + + + + + + + + + Folder 4 + + + + + + + + + + + + + + + + <chat-message> + + + + + + + + + + + + + + + + + message + + + + + + + + + + + + + + + + + ChatMessage + <html> +userService:UserService<br> +message:Message<br> +currentUser:User<br> +incoming:boolean<br> +constructor()<br> +onInit()<br> + + + + + + + + + + + + + + + + + + + UserService + + + + + + + + + + + + + + + + + + + + + + ChaNavBar + + + + + + + + + + Folder 5 + + + + + + + + + + + + + + + + <nav-bar> + + + + + + + + + + + + + + + + + ChatNavBar + <html> +threadsService:ThreadService<br> +messagesService:MessageService<br> +unReadMessageCount<br> +constructor()<br> +onInit()<br> + + + + + + + + + + + + + + + + + + + + ThreadService + + + + + + + + + + + + + + + + + MessageService + + + + + + + + + + + + + + + + + + + + + + ChatThreads + + + + + + + + + + Folder 6 + + + + + + + + + + + + + + + + <chat-threads> + + + + + + + + + + + + + + + + + ChatThreads + <html> +threadsService:ThreadService<br> +threads:Observable<br> +constructor()<br> + + + + + + + + + + + + + + + + + + + + ThreadService + + + + + + + + + + + + + + + + + <chat-thread> thread[i] + + + + + + + + + + + + + + + + ChatWindow + + + + + + + + + + Folder 7 + + + + + + + + + + + + + + + + <chat-window> + + + + + + + + + + + + + + + + + ChatWindow + <html> +messagesService:MessageService<br> +threadsService:ThreadService<br> +userService:UserService<br> +messages:Observable<br> +currentThread:Thread<br> +draftMessage:Message<br> +currentUser:User<br> +constructor()<br> +onInit()<br> +onEnter()<br> +sendMessage()<br> +scrollToBottom() + + + + + + + + + + + + + + + + + + + <chat-message> message[i] + + + + + + + + + + + + + + + + + ThreadService + + + + + + + + + + + + + + + + + MessageService + + + + + + + + + + + + + + + + + UserService + + + + + + + + + + + + + + + + + + + + + + ChatApp + + + + + + + + + + Folder 8 + + + + + + + + + + + + + + + + <chat-app> + + + + + + + + + + + + + + + + + ChatThread + <html> +messagesService:MessageService<br> +threadsService:ThreadService<br> +userService:UserService<br> +constructor()<br> + + + + + + + + + + + + + + + + + + + + ThreadService + + + + + + + + + + + + + + + + + MessageService + + + + + + + + + + + + + + + + + UserService + + + + + + + + + + + + + + + + + + + e.g. currentThread subject + is resolved to a +Thread via subscribe + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Overview of +Chat Application +(Version ngbook-r10) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + injects + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Dataflow + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Component +nesting + + + + + + + + + + + + + + + + diff --git a/doc/ChatApp.pdf b/doc/ChatApp.pdf new file mode 100644 index 0000000..a3ff281 Binary files /dev/null and b/doc/ChatApp.pdf differ