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
Lazy boxes, Multiple boxes, Watch grammatically? #115
Comments
I think this is related to #20. I'm not sure if it is something Hive needs to provide because it is very bloc specific and you can do it easily yourself using the
This depends on the size of your messages. I would say it is still okay to have this amount of messages in RAM but it should not be much more. Consider using lazy boxes as an alternative.
Yes, like the error says, you cannot use type arguments for lazy boxes. This has nothing to do with the |
That issue is not related. What i mean is to open a box lazley, with my
model passed on, and have watchBoxBuilder for UI.
In case of not being able to use WatchBoxBuilder with lazy mode , i still
nèd a way to get box values and updates and pass them from my bloc, in this
case, with lazy box i did not know how to fetch its values without passing
my model, because i have to do some query like where on it.
For the second part my model is 5 String objects, max size of 255 chars, so
255×5 per box, x 10 boxes max.
…On Tue, Nov 5, 2019, 01:54 Simon Leier ***@***.***> wrote:
I am planing to use flutter_bloc as for managing state, and wish to get
the data and updates throught the bloc events and state. i tried calling
watch() method on a box on my bloc but that would only get the activities
plus values of it, but not the already stored values.
I think this is related to #20 <#20>.
I'm not sure if it is something Hive needs to provide because it is very
bloc specific and you can do it easily yourself using the box.watch()
method.
second question, my app would store messages in many other boxes, will
that be an issue on ram? say 10 boxes, with each 1000 entry?
This depends on the size of your messages. I would say it is still okay to
have this amount of messages in RAM but it should not be much more.
Consider using lazy boxes as an alternative.
i could open the box without specifying type, but that will not allow me
to use WatchBoxBuilder, so in order to get the best of boxes and mainataine
clean code and performance what should i do please?
Yes, like the error says, you cannot use type arguments for lazy boxes.
This has nothing to do with the WatchBoxBuilder and it should work as
always.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#115>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE2QCN5BSXTKE52N2UT74ODQSCRZHANCNFSM4JIVEAQQ>
.
|
|
Question
Hello there, what is the equivalent to WatchBoxBuilder, in order to get the current values and updates events?
I am planing to use flutter_bloc as for managing state, and wish to get the data and updates throught the bloc events and state. i tried calling watch() method on a box on my bloc but that would only get the activities plus values of it, but not the already stored values.
second question, my app would store messages in many other boxes, will that be an issue on ram? say 10 boxes, with each 1000 entry?
third question, my understanding after reading docs, is that if i have many boxes and do not want to put more data into memory, i should use lazy boxes instead, but i got the error,
[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: HiveError: Lazy boxes do not support type arguments.
i could open the box without specifying type, but that will not allow me to use WatchBoxBuilder, so in order to get the best of boxes and mainataine clean code and performance what should i do please?
Version
The text was updated successfully, but these errors were encountered: