Comparing version 5.4.0 to 5.5.0
@@ -340,2 +340,7 @@ /** | ||
/** | ||
* Get access to the underlying template renderer. Each render call | ||
* to edge results in creating an isolated renderer instance. | ||
*/ | ||
onRender(callback: (renderer: EdgeRendererContract) => void): this; | ||
/** | ||
* Get a renderer instance to render templates | ||
@@ -342,0 +347,0 @@ */ |
@@ -24,2 +24,6 @@ import { Loader } from '../Loader'; | ||
/** | ||
* Array of registered renderer hooks | ||
*/ | ||
private renderCallbacks; | ||
/** | ||
* Reference to the registered processor handlers | ||
@@ -136,2 +140,7 @@ */ | ||
/** | ||
* Get access to the underlying template renderer. Each render call | ||
* to edge results in creating an isolated renderer instance. | ||
*/ | ||
onRender(callback: (renderer: EdgeRendererContract) => void): this; | ||
/** | ||
* Returns a new instance of edge. The instance | ||
@@ -138,0 +147,0 @@ * can be used to define locals. |
@@ -67,2 +67,6 @@ "use strict"; | ||
/** | ||
* Array of registered renderer hooks | ||
*/ | ||
this.renderCallbacks = []; | ||
/** | ||
* Reference to the registered processor handlers | ||
@@ -223,2 +227,10 @@ */ | ||
/** | ||
* Get access to the underlying template renderer. Each render call | ||
* to edge results in creating an isolated renderer instance. | ||
*/ | ||
onRender(callback) { | ||
this.renderCallbacks.push(callback); | ||
return this; | ||
} | ||
/** | ||
* Returns a new instance of edge. The instance | ||
@@ -229,3 +241,5 @@ * can be used to define locals. | ||
this.executePlugins(); | ||
return new Renderer_1.EdgeRenderer(this.compiler, this.asyncCompiler, this.GLOBALS, this.processor); | ||
const renderer = new Renderer_1.EdgeRenderer(this.compiler, this.asyncCompiler, this.GLOBALS, this.processor); | ||
this.renderCallbacks.forEach((callback) => callback(renderer)); | ||
return renderer; | ||
} | ||
@@ -232,0 +246,0 @@ /** |
{ | ||
"name": "edge.js", | ||
"version": "5.4.0", | ||
"version": "5.5.0", | ||
"description": "Template engine", | ||
@@ -77,3 +77,3 @@ "main": "build/index.js", | ||
"edge-lexer": "^4.0.10", | ||
"edge-parser": "^8.2.0", | ||
"edge-parser": "^8.2.1", | ||
"js-stringify": "^1.0.2", | ||
@@ -80,0 +80,0 @@ "macroable": "^7.0.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
142808
4128
Updatededge-parser@^8.2.1