This repository has been archived by the owner on Sep 7, 2022. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Because of this issue: #52
I created another version of the database example which uses only transactions for adding/removing/updating data.
I was able to rewrite it and have it working (also with delete through the transaction).
BUT!
I started to play with it and I have found a big differences in final behaviour of Dart and js version when the transaction function returns the same thing.
When I try to do this the transaction method:
return undefined;
undefined
(without any interop?). So the only way is to return the old data… I can't usereturn null;
for thisreturn null;
return;
return undefined;
return null;
return {};
So the problem is that I am not able to simply do "abortion of the transaction" in Dart (only return the old data) and that
return null
doesn't work for node deletion after compilation. But I found the workaround ofreturn {};
(it's commented in the sample)I know that there is this issue but what about devs using the library. Mention this in the documentation of transaction() function? What do you think?