This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "); | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(func $calc_i32 (; 0 ;) (param $0 i32) (result i32) | |
( | |
(get_local $0) | |
(i32.const 10) | |
i32.mul) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int calc (int a) | |
{ | |
return a * 10; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[no_mangle] | |
pub fn calc(a: i32, b: i32) -> i32 { | |
if a > 10 { | |
return a * 5; | |
} | |
b * a | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int calc(int a, int b) | |
{ | |
if (a > 10) | |
return a * 5; | |
return a * b; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const foo = | |
const foo = x | |
const foo = x > | |
const foo = x => | |
const foo = x ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function init () { | |
"use strict"; | |
var counter; | |
function inc() { | |
counter++; | |
return counter; | |
} | |
return inc; |