lib/dry/component/container.rb in dry-component-0.4.2 vs lib/dry/component/container.rb in dry-component-0.4.3

- old
+ new

@@ -121,10 +121,12 @@ Kernel.require path.to_s } end def self.load_component(key) + return self if key?(key) + component = loader.load(key) src_key = component.namespaces[0] if imports.key?(src_key) src_container = imports[src_key] @@ -143,9 +145,11 @@ else raise e end end end + + self end def self.require_component(component, &block) path = load_paths.detect { |p| p.join(component.file).exist? }