@robotlegsjs/core
Version:
An architecture-based IoC framework for JavaScript/TypeScript
35 lines • 1.5 kB
JavaScript
;
// ------------------------------------------------------------------------------
// Copyright (c) 2017-present, RobotlegsJS. All Rights Reserved.
//
// NOTICE: You are permitted to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
// ------------------------------------------------------------------------------
Object.defineProperty(exports, "__esModule", { value: true });
exports.ObjectHandler = void 0;
var ObjectHandler = /** @class */ (function () {
/*============================================================================*/
/* Constructor */
/*============================================================================*/
/**
* @private
*/
function ObjectHandler(matcher, handler) {
this._matcher = matcher;
this._handler = handler;
}
/*============================================================================*/
/* Public Functions */
/*============================================================================*/
/**
* @private
*/
ObjectHandler.prototype.handle = function (object) {
if (this._matcher.matches(object)) {
this._handler(object);
}
};
return ObjectHandler;
}());
exports.ObjectHandler = ObjectHandler;
//# sourceMappingURL=ObjectHandler.js.map