Skip to content

Support for inline arguments with constructor injection

Choose a tag to compare

@thetutlage thetutlage released this 02 Jul 10:16

From this release onwards, the caller of make method can pass inline arguments along with constructor injection.

class Bar {}

@inject()
class Foo {
   constructor (public config, public bar: Bar) {
   }
}

make it as follows

const configObject = {}

const foo = ioc.make(Foo, [configObject])

assert.deepEqual(foo.config, configObject)
assert.instanceOf(foo.bar, Bar)

Commits

  • feat: add support for inline dependencies with 78f0ac1
  • chore(package): update dependencies 67202d3
  • chore(deps-dev): bump tslint from 5.16.0 to 5.18.0 (#22) 98199dc
  • chore(deps-dev): bump typescript from 3.5.1 to 3.5.2 (#25) 5dfe02f
  • chore(package): update dependencies df3c18a
  • chore(deps-dev): bump np from 5.0.2 to 5.0.3 (#21) 572e7b5
  • chore(deps): bump @poppinss/utils from 1.0.2 to 1.0.3 (#18) c4e854f
  • chore(deps-dev): bump ts-node from 8.2.0 to 8.3.0 (#19) 12955c5
  • chore(deps-dev): bump @types/node from 12.0.3 to 12.0.10 (#20) 9475f7a

v6.0.3...v6.1.0