strvcom / ios-chat-component

Chat modular library
MIT License
1 stars 1 forks source link

Feat/firebase data #2

Closed danpecher closed 4 years ago

danpecher commented 4 years ago

Comments

danpecher commented 4 years ago

@schwarja I added some new commits.

I added a new method load to the core to be able to load all users before the conversations are loaded. I think in the future it could be used also for some other loading tasks that might be needed.

I used notifications to call the temporary createTestConversation method for simplicity, because if I wanted to call Firebase methods from controller or appdelegate I would have to mess around with dependencies to be able to import them.

danpecher commented 4 years ago

@schwarja I added commits and some comments 🙂

danpecher commented 4 years ago

@schwarja ok I managed to do the load without exposing through the core by adding onLoadListeners to ChatNetworkingFirebase so that even if listenToConversations is called before the init is done, the code will wait until loading is complete. I hope this solution is not too ugly 😬 this specific code change is here: https://github.com/strvcom/ios-research-chat-component-imperative/pull/2/commits/f0846b2fa0653c4dc59a5a3aefac89a52036a003

danpecher commented 4 years ago

@schwarja done