Skip to content

Instantly share code, notes, and snippets.

View gskachkov's full-sized avatar

Oleksander Skachkov gskachkov

  • Itera Consulting
  • Ukraine, Kiev
View GitHub Profile
[Layout(typeof(MainLayout)), Route("/fetchdata")]
public class FetchData : BlazorComponent
{
private WeatherForecast[] forecasts;
[CompilerGenerated, DebuggerBrowsable(0)]
private HttpClient <Http>k__BackingField;
protected override void BuildRenderTree(RenderTreeBuilder builder)
{
base.BuildRenderTree(builder);
[Layout(typeof(MainLayout)), Route("/counter")]
public class Counter : BlazorComponent
{
private int currentCount = 0;
protected override void BuildRenderTree(...)
{
...
builder.AddContent(4, "Current count: ");
builder.AddContent(5, (int) this.currentCount);
public class MainLayout :
BlazorComponent, ILayoutComponent, IComponent
{
protected override void BuildRenderTree(...)
{
base.BuildRenderTree(builder);
builder.OpenElement(1, "div");
builder.AddAttribute(2, "class", "container-...
builder.AddContent(3, "\n ");
...
(func $calc_i32 (; 0 ;) (param $0 i32) (result i32)
(
(get_local $0)
(i32.const 10)
i32.mul)
)
int calc (int a)
{
return a * 10;
}
(module
(table 0 anyfunc)
(memory $0 1)
(export "memory" (memory $0))
(export "_Z4calcii" (func $_Z4calcii))
(func $_Z4calcii (; 0 ;) (param $0 i32) (param $1 i32) (result i32)
(i32.mul
(select
(i32.const 5)
(get_local $1)
#[no_mangle]
pub fn calc(a: i32, b: i32) -> i32 {
if a > 10 {
return a * 5;
}
b * a
}
int calc(int a, int b)
{
if (a > 10)
return a * 5;
return a * b;
}
const foo =
const foo = x
const foo = x >
const foo = x =>
const foo = x ?
function init () {
"use strict";
var counter;
function inc() {
counter++;
return counter;
}
return inc;