Function di

Make function Dependency Injection friendly

Responded function should be called within diInit callback

const fun = di(x => x + 1)
fun(1) // 2
diSet(fun, x => x + 2)
fun(1) // 3
  • Type Parameters

    • T extends Function

    Parameters

    • fn: T

    Returns T