Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 594 Bytes

deprecating.md

File metadata and controls

24 lines (19 loc) · 594 Bytes

Deprecating services

This feature allows to display deprecation note when service marked as deprecated gets created.

// via decorator
// will display "Service DeprecatedService is deprecated: Use RedisCache instead" on attempt of
@Deprecated('Use RedisCache instead')  
@Service()
class DeprecatedService {
    
}
// manually via annotation

container.definitionWithValue('foo', {a: 'service'})
    .annotate(deprecated('Use RedisCache instead'));
container.get('foo')
// console.warn: Service foo is deprecated: Use RedisCache instead