mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Fixes #78 - Passthrough if a provided template is already a loaded template instance
This commit is contained in:
parent
db951ce90d
commit
41e92df68c
@ -218,6 +218,11 @@ function load(templatePath, options) {
|
||||
template._ = loader(templatePath).create(helpers); // Load the template factory and invoke it
|
||||
}
|
||||
} else {
|
||||
// If the first argument is already a loaded template then just return it
|
||||
if (templatePath.render) {
|
||||
return templatePath;
|
||||
}
|
||||
|
||||
// Instead of a path, assume we got a compiled template module
|
||||
// We store the loaded template with the factory function that was
|
||||
// used to get access to the compiled template function
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user