-
Notifications
You must be signed in to change notification settings - Fork 85
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
feat: add support for async based resource operation handlers #523
Merged
Commits on Aug 18, 2024
-
ref: remove unnecessary serviceMeta in middleware
The callback passed to .end method receives 3 arguments: err, data and meta. Therefore, we don't need to capture meta in the serviceMeta array as we used to do.
Configuration menu - View commit details
-
Copy full SHA for aa37564 - Browse repository at this point
Copy the full SHA aa37564View commit details -
ref: prepare _executePromise to handle async resource handlers
- Remove unnecessary setImmediate (since we started using promises, we are not blocking the main thread anymore). - Move _executeRequest to Request class (since it operates quite heavily on the request object). - _executeRequest always resolves now. The resolved object contains an err, data and meta properties. This change allows us to simplify .end and ._captureMetaAndStats methods. - _captureMetaAndStats is simpler now, it takes the err and meta object directly so we don't need to guess if they exist or not.
Configuration menu - View commit details
-
Copy full SHA for 383e0ad - Browse repository at this point
Copy the full SHA 383e0adView commit details -
feat: add support for async based resource handlers
With this change, it's now possible to use fetchr fully callbackless. If any resource handler is defined with one or less arguments, we expect this resource to be async and we pass all the arguments in just one object to it (which also simplifies the signature of the handlers).
Configuration menu - View commit details
-
Copy full SHA for 8938b74 - Browse repository at this point
Copy the full SHA 8938b74View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8452a65 - Browse repository at this point
Copy the full SHA 8452a65View commit details -
Configuration menu - View commit details
-
Copy full SHA for a344f45 - Browse repository at this point
Copy the full SHA a344f45View commit details -
Configuration menu - View commit details
-
Copy full SHA for d24c425 - Browse repository at this point
Copy the full SHA d24c425View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8e62470 - Browse repository at this point
Copy the full SHA 8e62470View commit details
Commits on Aug 19, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 6a0d88e - Browse repository at this point
Copy the full SHA 6a0d88eView commit details
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.