You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 2, 2018. It is now read-only.
@@ -25,11 +31,11 @@ For hello-extensions we write a simple Mixin that allows the `Application` class
25
31
#### An example Logger
26
32
```ts
27
33
classColorLoggerimplementsLogger {
28
-
log(...args:any[]) {
34
+
log(...args:LogArgs) {
29
35
console.log('log :', ...args);
30
36
}
31
37
32
-
error(...args:any[]) {
38
+
error(...args:LogArgs) {
33
39
const data =args.join('');
34
40
// log in red color
35
41
console.log('\x1b[31m error: '+data+'\x1b[0m');
@@ -47,15 +53,22 @@ It is also important for the constructor to call `super(args)` so `Application`
47
53
```ts
48
54
constructor(...args: any[]) {
49
55
super(args);
50
-
}```
56
+
}
57
+
```
51
58
52
59
### Binding via `ApplicationOptions`
53
60
As mentioned earlier, since our `args` represents `ApplicationOptions`, we can make it possible for users to pass in their `Logger` implementations in a `loggers` array on `ApplicationOptions`. We can then read the array and automatically bind these for the user.
0 commit comments