Skip to content

Adapter should not use typeof #3795

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

Closed
wants to merge 1 commit into from
Closed

Adapter should not use typeof #3795

wants to merge 1 commit into from

Conversation

MickL
Copy link
Contributor

@MickL MickL commented Feb 6, 2021

Not sure why typeof was used but Adapter is a class and does not need a typeof. The problem is that it was not possible to have a function thats return type is an Adapter:

const createAdapter = (): Adapter => { ... };
server.adapter(createAdapter());

If there is a reason for use of typeof then the types should be Adapter | typeof Adapter

The kind of change this PR does introduce

  • a bug fix
  • a new feature
  • an update to the documentation
  • a code change that improves performance
  • other

Current behavior

New behavior

Other information (e.g. related issues)

Not sure why `typeof` was used but Adapter is a class and does not need a typeof. The problem is that it was not possible to have a function thats return type is an Adapter:

```
const createAdapter = (): Adapter => { ... };
server.adapter(createAdapter());
```
@MickL MickL closed this Feb 6, 2021
@MickL
Copy link
Contributor Author

MickL commented Feb 6, 2021

This PR might be wrong from me. But I create an issue and hope for an answer from the maintainer(s) #3796

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant