const fun = di(x => x + 1)
fun(1) // 2
diSet(fun, x => x + 2)
fun(1) // 3
DiNotInitializedError if called outside of diInit callback
Register any value inside Dependency Injection container by unique string literal
Can be extracted later using diDep
Should be called within diInit callback
type User = {
login: string;
roles: string[];
}
const user: User = {login: 'root', roles: ['admin']}
diSet('user', user)
diDep<User>('user') // {login: 'root', roles: ['admin']}
DiNotInitializedError if called outside of diInit callback
Override Dependency Injection friendly function with another one
Should be called within diInit callback