added files in git
This commit is contained in:
17
src/stores/chatPostStore.js
Normal file
17
src/stores/chatPostStore.js
Normal file
@@ -0,0 +1,17 @@
|
||||
const postByChatId = new Map();
|
||||
|
||||
export function setPostForChat(chatId, post) {
|
||||
postByChatId.set(chatId, post);
|
||||
}
|
||||
|
||||
export function getPostForChat(chatId) {
|
||||
return postByChatId.get(chatId);
|
||||
}
|
||||
|
||||
export function cachePostsFromChats(chats) {
|
||||
for (const chat of chats) {
|
||||
if (chat.post) {
|
||||
postByChatId.set(chat.id, chat.post);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user