edge
edge copied to clipboard
How can I sharing node.js object between callings of Edge.Func(@"_javascript_code_");
Hi there,
I'm researching with Node.js in a C# process so I dont known how to get the static object between callings of Edge.Func(@"javascript_code");
`public class TestNodeJs { public static async void Start() { var func = Edge.Func(@"
const num = 5;
return function (data, callback) {
callback(null, "Node.js welcomes "+ num);
}
");
Console.WriteLine(await func(null));
var func2 = Edge.Func(@"
return function (data, callback) {
callback(null, 'Node.js welcomes ' + num);
}
");
Console.WriteLine(await func2(null));
}
}`
I got error when try to access to variable num at the second time!