dependencies icon indicating copy to clipboard operation
dependencies copied to clipboard

Shield object should support builtin types.

Open proofit404 opened this issue 5 years ago • 0 comments

This will be probably an easier way to solve #432

class Container(Injector):

    calculations = shield(list, this.calc1, this.calc2, this.calc3)

    calc1 = Calc1

    calc2 = Calc2

    calc3 = Calc3

Container.calculations  # build list of instantiated dependencies
class Container(Injector):

    calculations = shield(dict, x=this.calc1, y=this.calc2, z=this.calc3)

    calc1 = Calc1

    calc2 = Calc2

    calc3 = Calc3

Container.calculations  # build dict of instantiated dependencies with "x", "y" & "z" keys.

proofit404 avatar Jan 26 '21 12:01 proofit404