Adds query to transaction and refactor transaction to reuse the get etc functions#102
Open
ftzi wants to merge 14 commits intokossnocorp:v8from
Open
Adds query to transaction and refactor transaction to reuse the get etc functions#102ftzi wants to merge 14 commits intokossnocorp:v8from
ftzi wants to merge 14 commits intokossnocorp:v8from
Conversation
ftzi
commented
Nov 11, 2021
|
|
||
| return readFunction({ get }).then((data) => | ||
| return readFunction({ | ||
| get: (...props) => (getCommon as any)(props[0], props[1], props[2], {a, t}), |
Author
There was a problem hiding this comment.
I had to as any because all those generics and overloads of get weren't matching, but it's the same params order. Tried to get it working without the type cast but hadn't success.
Also, I props[0], props[1], props[2] instead of ...props because some of them are optional and would make {a, t} be in the wrong param instead of the forth one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Queries can be used in transactions if running on server, as I read and tried (haven't tried on client yet but working on server). #6 #95
Also, as you mentioned in the code, you rewrote the get etc functions inside the transaction.
typesaurus/src/transaction/index.ts
Lines 308 to 311 in e4c2fa3
I have made a quick workaround so both get() and transaction's get() uses the same common function. Done the same for query(). It can also be done for the other transaction functions but won't do it until you think it's a good idea.
This branch is working but leaving as a Draft until further discussion and maybe improvements.