Closed HaruTzuki closed 1 year ago
Kudos, SonarCloud Quality Gate passed!
I'm curious what is the use case for this?
In order to compile a text with handlerbars you need first to compile the text to take the template and after that you need to pass the object. I decided it will be great this to happens in one line if you need to use it in a lamda expression e.g.
public string GetText(string source, object handles)=>Handlebars.Compile(source, handles); // something like that.
I’m not sure we’d want to promote this style of usage to be a peer method with the other Compile methods. For many developers who do not understand all the implications, this is needlessly recompiling the template every time the input changes, just to save a line of code. If it’s so important to include as a convenience, how could we make it more obvious this is fundamentally different than merely compiling?
Ok then... Delete the PR.
Happy to reopen if anyone feels strongly enough about this to address the ergonomics issue.
I am working in a project and I thought this will be a great method.