11 Matching Annotations
- Nov 2019
-
docs.silverstripe.org docs.silverstripe.org
-
Instead of overriding a service with your own implementation, you enhance an existing service with your own concerns. This pattern is known as middleware.
-
-
gist.github.com gist.github.com
-
-
Injector components should never be self-closing, and they should never wrap multiple children. We can fix this at code-time and not wait for the errors at runtime.
-
React Native has also used this pattern in TouchableWithoutFeedback
-
we use a LOT of injector components to abstract out logic and nicely separate concerns like style, animation, and interactions from our layout components.
-
An injector component takes props, optionally computes new ones, then injects them into its child via React.cloneElement(). Crucially, it also does not add any new components to the DOM.
-
-
gist.github.com gist.github.com
-
Aligning closely with the <Injector_ > naming convention, Null Components are denoted with a prefix and postfix _ (e.g. <_NullComponent_ />).
-
- Feb 2017
-
angular.io angular.io
-
In general, add providers to the root module so that the same instance of a service is available everywhere.
So, from this I take it that once a Service is added to the root module, it can be used by any component of that module.
What about the components imported, from sub-modules of the root one? Can their dependency needs be met, in similar fashion? For example, could a Component in another module (imported into the root one) just request a Service provided in the root module and have it properly injected from there, without anything else on the developer's part?
-
you get a new instance of the service with each new instance of that component
So, I take it that the Service instance will not be a singleton anymore? Whereas, if provided from the root module, it will?
-