Skip to content

API wart: server.dependency after method lacks options #2520

@garthk

Description

@garthk

I find myself having to do this a fair bit:

function register(server, options, next) {
    server.dependency(['auth-plugin'], function (_server, _next) {
        after(_server, options, _next));
    }
}

function after(server, options, next) {
    // ... register routes, etc
}

Sure, I could use closures… but if the after API is designed around closures, why are we passing it server? If there's a reason to pass server, there's a reason to pass options.

Do we have a bug category for "API changes waiting for enough friends to justify a major version bump"?

Metadata

Metadata

Assignees

Labels

featureNew functionality or improvement

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions