Skip to content

Context bindings - Type Safety / IntelliSense  #67

@superkhau

Description

@superkhau

See https://github.com/strongloop/loopback-next/pull/61/files#r102336527

We need to make it easy to know the input and output of the ctx's APIs. Here are some examples

// Hard to remember the string, easy to introduce typos
ctx.bind('someLongStringHere').to(SomeType);

// Does MyConcreteType implement MyInterface ???
// would be nice if the compiler checked this for me
ctx.bind('MyInterface').to(MyConcreteType);

// when I refactor code - I don't want to have to go find/replace all instances of 'someString'
ctx.bind('someString').to(SomeValue);

Metadata

Metadata

Assignees

Labels

IoC/Context@loopback/context: Dependency Injection, Inversion of Controlfeature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions