-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Hey, your folk's library is extremely close to what we need for our website we're working on. Straightforward, fairly small emit size, separate types file, etc. However, two features would be really useful:
- wrapping all the emitted functions in a class
- (minor) option for automatically unwrapping returned data, otherwise throwing an
HttpError
The first is useful because it lets you extend the class and modify API calls using super, like so:
class MyAPI extends GeneratedAPI {
override async authCheckLogin() {
const result = await super.authCheckLogin()
// set some global state depending on result, like an `isLoggedIn` observable or something
return result
}
}You could get more detailed and wrap everything in a class but this isn't strictly needed.
The second request is just for convenience, it isn't strictly necessary as it isn't too difficult to do this with some class expression magic, but it would cut down on boilerplate.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request