Skip to content

Commit

Permalink
fix(info): Implement info interceptor.
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaliy-bobrov committed Jan 15, 2018
1 parent 7f0cd08 commit d3516b7
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.9.14
### Bug Fixes:
- Implemented missed `info` interceptor.

## 0.9.13
### Bug Fixes:
- Fix arrow function arguments.
Expand Down
3 changes: 2 additions & 1 deletion lib/angular-hot-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let hotAngular;
* Angular Hot Loader.
* @param {Object} settings - hot loader setiings.
*/
var HotAngular = function(settings) {
const HotAngular = function(settings) {
const toString = Function.prototype.toString;

this.ANGULAR_MODULE;
Expand Down Expand Up @@ -83,6 +83,7 @@ HotAngular.prototype.decorator = require('./interceptors/decorator');
HotAngular.prototype.directive = require('./interceptors/directive');
HotAngular.prototype.factory = require('./interceptors/factory');
HotAngular.prototype.filter = require('./interceptors/filter');
HotAngular.prototype.info = require('./interceptors/info');
HotAngular.prototype.module = require('./interceptors/module');
HotAngular.prototype.provider = require('./interceptors/provider');
HotAngular.prototype.run = require('./interceptors/run');
Expand Down
2 changes: 1 addition & 1 deletion lib/interceptors/constant.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = function(name, constant) {
var exists = !!this.constantCache[name];
const exists = !!this.constantCache[name];

this.constantCache[name] = constant;

Expand Down
8 changes: 8 additions & 0 deletions lib/interceptors/info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = function(info) {
this.logger(`INFO:
${info}`, 'info');

this.ANGULAR_MODULE.info(info);

return this;
};
2 changes: 1 addition & 1 deletion lib/interceptors/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = function(name, serviceFunction) {
this.logger(`SERVICE "${name}":
${serviceFunction}`, 'info');

var intercept = function($provide) {
const intercept = function($provide) {
$provide.decorator(name, function($delegate) {
return $delegate;
});
Expand Down
2 changes: 1 addition & 1 deletion lib/interceptors/value.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = function(name, value) {
var exists = !!this.valueCache[name];
const exists = !!this.valueCache[name];

this.valueCache[name] = value;

Expand Down
4 changes: 1 addition & 3 deletions lib/logger.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var logger = function(message, level) {
module.exports = function(message, level) {
level = level || 'log';

/* eslint-disable */
Expand All @@ -9,5 +9,3 @@ var logger = function(message, level) {
}
/* eslint-enable */
};

module.exports = logger;

0 comments on commit d3516b7

Please sign in to comment.