Closed kimm950 closed 1 year ago
@kimm950 Tested out the feature. Works great! I made some suggestions though!
@kimm950 I noticed the beat player starts when typing a message and entering space key. Other than that feature works great!
@aburd
to make chats a top-level key in firebase
Agreed and I started working on this. Got one thing to discuss though. Do you think I should generate group data by using the new chat API? like how you did for the users in group? or call the chat API independently from the component directly?
@kimm950
Do you think I should generate group data by using the new chat API? like how you did for the users in group? or call the chat API independently from the component directly?
If I understand what you're asking correctly, you're wondering about how much logic surrounding the API we should expose to components by putting most of the logic in the API modules, right? maybe like what I did here.
If that's the case, the components shouldn't know about any of the messy details of the database. The API should take care of all the heavy-lifting. For example, all the users can do right now is chat inside the group. Therefore, when you create a group
, it should come with a chat
. So you'd need to add that chat create api, then include it in the group create api. The page
component should do all the data fetching as is necessary and pass it on to its children.
At least that's what I feel!
@aburd
So you'd need to add that chat create api, then include it in the group create API
let me do this 👍 thanks for the suggestions
@aburd Made the chat as a top-level key and resolved the conflicts from this PR
@kimm950 LGTM!
IMPORTANT: Please do not create a Pull Request without creating an issue first.
close https://github.com/aburd/beats-with-friends/issues/12
*Any change needs to be documented in issues so that people are aware of what's being developed. Made
chats
as a top-level key in the dbI created the new API and the db setting for the chat.
Please check if the PR fulfills these requirements
[x] The commit message follows our guidelines
[ ] Tests for the changes have been added (for bug fixes / features)
[ ] Docs have been added / updated (for bug fixes / features)
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Create API to
get
/subscribe
/create
/addMessage
chat data Create UI to chat with other members in a groupWhat is the current behavior? (You can also link to an open issue here) https://github.com/aburd/beats-with-friends/issues/12
What is the new behavior (if this is a feature change)?
Users can send messages in the group
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Probably, I am not sure if this data structure change will affect the existing feature. I need a careful review from @aburd Wonder if some key code events will be affected while users are typing
Other information:
none