Skip to content

Releases: honkjs/injector

v2.0.0

01 Mar 20:59
Compare
Choose a tag to compare

Accept services when creating injector middleware.

// 1.0:  services were added in another middleware
const honk = new Honk()
  .use(injector())
  .use((app, next) => {
    app.services.api = api;
    return next;
  }).honk;

// 2.0: Services are passed into the constructor
const honk = new Honk()
  .use(injector({ api })).honk;

// Change is backwards compatible

v1.0.5...v2.0.0