12 Matching Annotations
  1. Jul 2022
  2. Nov 2019
    1. You might want developers building projects with this CMS to be able to change the behaviour of some UIs, or to be able to provide new components that can be consumed by the CMS. Those components can't easily be included in the JS bundle for the CMS, as it would require recompiling the shipped code with outside references.
    1. before and after also accept arrays of constraints.

      controlling order

    2. Registering new services to the Injector If you've created a module using React, it's a good idea to afford other developers an API to enhance those components, forms, and state. To do that, simply register them with Injector.
    3. Instead of overriding a service with your own implementation, you enhance an existing service with your own concerns. This pattern is known as middleware.
  3. Feb 2017
    1. 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?

    2. 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?

  4. Apr 2016
    1. Interesting article on dependency injection and combining FP and OOP. The central question explored is how a language might work if function parameters were split into two categories, data and services/environment.

    1. How is all this different from mainstream constructors?Because an instance is created by sending a message to an object, and not by some special construct like a constructor invocation, we can replace the receiver of that message with any object that responds to that message. It can be another class (say, an implementation based on polar coordinates), or it can be a factory object that isn’t a class at all.

      Question: Is this different in any way from say Python where objects are constructed using a function call?