Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using update in onTextChange #96

Closed
zeevl opened this issue Mar 14, 2020 · 2 comments
Closed

Using update in onTextChange #96

zeevl opened this issue Mar 14, 2020 · 2 comments

Comments

@zeevl
Copy link

zeevl commented Mar 14, 2020

Hey @IjzerenHein, I've been investigating this package and it seems like a great fit for our project!

One thing that has me concerned, though. Your example apps call update in onChangeText, which means the firebase update will be called for essentially every key press? Seems this could get expensive in text-heavy applications..

Am I understanding this correctly? I would love to see some sort of deferred update which changes the observable values, and with a subsequent flush to persist the changes to Firestore, called at some later point (i.e. blur). But I didn't want to dive into something like this if you had a different approach in mind.. (perhaps with #53?)

@zeevl zeevl changed the title Using update in onTextChange Using update in onTextChange Mar 14, 2020
@IjzerenHein
Copy link
Owner

Hi! Well that's just an example, and it showcases how easy it can be to write some real-time updating code. I can very much imagine that you don't want to send an update action for every key-stroke though. In such a case I would just store the content in the state of your component and perhaps send it on accept or unmount. This is something that you would need to do yourself, or perhaps write an abstraction that handles this for you.

@zeevl
Copy link
Author

zeevl commented Mar 15, 2020

Thought that might be the case. Thank you!

@zeevl zeevl closed this as completed Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants