Handlebars-Net/Handlebars.Net

[Question] How to change root vars inside block helper

Opened this issue · 0 comments

Hi all! I'm trying to write a block helper which fill context var.
Root access example:

    handlebars.RegisterHelper("example", (output, options, context, arguments) =>  
    {  
	      count++;  
	      Console.WriteLine($"helper calls: {count}");  
	      var root = (JObject)options.Data["root"];  
	      root["someVar"] = root["someVar"].ToString() + count;

In this case 27 calls

But result is different

What is the reason and how do I fix this?