ruban-gt / justdi Goto Github PK
View Code? Open in Web Editor NEWSimple DI container
Home Page: https://github.com/RuBAN-GT/justdi
License: MIT License
Simple DI container
Home Page: https://github.com/RuBAN-GT/justdi
License: MIT License
Implement container sub-modules like this:
sub_module = Justdi::SubModule.new do |register|
register.call(:schema).use_class(Graphql::Schema)
register.call(:server).use_class(Graphql::Server)
end
container.import_module(sub_module)
Think about definition of the global justdi container for the whole ruby application without manual initialisation.
Justdi::Container.new do |register|
register(:some_token).use_value(42)
end
Think about ways to provide self contained definitions like as it was implemented in Angular.
class ComponentA
extend Justdi::Component
component do |metadata|
metadata.imports ComponentB
metadata.store SomeDefinitionStore
metadata.provider(
key1: { resolver: ->() { 42 } },
key2: { use_class: Custom }
)
end
end
container.import_module ComponentA
class ComponentA
extend Justdi::Component
component_metadata( # probably another name, idea about the single method
imports: ComponentB,
store: SomeDefinitionStore,
provider: {
key1: { resolver: ->() { 42 } },
key2: { use_class: Custom }
}
)
end
class ComponentA
extend Justdi::Component
component_imports ComponentB
component_store SomeDefinitionStore
component_provider key: { use_class: Custom }
end
The first approach (A) will be more flexible helping to avoid any conflicts.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.