mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
26 lines
632 B
JavaScript
26 lines
632 B
JavaScript
'use strict';
|
|
var AsyncStream = require('./AsyncStream');
|
|
var makeRenderable = require('../renderable');
|
|
|
|
function Template(path, renderFunc, options) {
|
|
this.path = path;
|
|
this._ = renderFunc;
|
|
this.$__shouldBuffer = !options || options.shouldBuffer !== false;
|
|
this.meta = undefined;
|
|
}
|
|
|
|
function createOut(globalData, parent, state, buffer) {
|
|
return new AsyncStream(globalData, parent, state, buffer);
|
|
}
|
|
|
|
Template.prototype = {
|
|
createOut: createOut,
|
|
stream: function() {
|
|
throw new Error('You must require("marko/stream")');
|
|
}
|
|
};
|
|
|
|
makeRenderable(Template.prototype);
|
|
|
|
module.exports = Template;
|