-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
Every now and then I find I want some extra control over injection. For instance, I may have a factory function that creates a class, so I name it's file upper case; or the filename isn't a legal JavaScript argument name. It would be nice to be able to override the default guessing behavior.
Maybe something like:
// Badly-Named-Class-Factory.js
module.exports = function factory(injectMe) {
return class SomeClass {
// ...
}
}
module.exports.$plutoConfig = {
strategy: 'factory', // treat this as a factory function
name: 'SomeClass' // change the name of the binding
}Note: this is a really dumb example, don't actually write code like this.