Conversation
| name: streamqflite | ||
| description: reactive stream wrapper around sqflite inspired by sqlbrite | ||
| version: 1.0.0 | ||
| version: 2.2.3 |
There was a problem hiding this comment.
Curious why 2.2.3? I guess to match sqflite? I don't think we need to actually track that closely with versions so 2.0.0 would be fine.
| Database? db; | ||
| StreamDatabase? streamDb; |
There was a problem hiding this comment.
I think you can declare these as late to avoid the unwrapping latter https://dart.dev/null-safety/understanding-null-safety#late-variables
| return _source.asyncMap((query) => query()).map((rows) { | ||
| var result = List<T>(rows.length); | ||
| //var result = List<T>(rows.length); | ||
| List<T> result = []; |
There was a problem hiding this comment.
This removes the admittedly minor optimization of sizing the list so it doesn't have to reallocate, just curious if there's a way to do that now, maybe by defining a capacity?
There was a problem hiding this comment.
After searching might be able to use https://api.dart.dev/stable/2.16.2/dart-core/List/List.generate.html?
| Stream<List<T>> mapToList<T>(T mapper(Map<String, dynamic> row)) { | ||
| return _source.asyncMap((query) => query()).map((rows) { | ||
| var result = List<T>(rows.length); | ||
| //var result = List<T>(rows.length); |
There was a problem hiding this comment.
Would be good to remove commented out code
|
Thank you :D I'll keep it in mind. |
No description provided.