One of my favorite features of C# 6 is string interpolation. It helps move unnecessary string.format(...)
noisy code.
Here's a quick example:
var person = new Person {FirstName = "Jose", LastName = "Gonzalez"};
function Button (props) { | |
// Returns a DOM element here. For example: | |
return <button type="submit">{props.label}</button>; | |
} | |
function ProfilePic(props) { | |
return ( | |
<img src={props.url} /> | |
); | |
} |
import React from 'react'; | |
function RobotMaster(props) { | |
return ( | |
<li> | |
<img src={props.avatar}/> {props.name} -> {props.weapon} | |
</li> | |
) | |
} |
import React, {Component} from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import RobotMaster from './robotmaster'; | |
function RobotItem(props) { | |
return ( | |
<li> | |
{props.name} | |
</li> |
One of my favorite features of C# 6 is string interpolation. It helps move unnecessary string.format(...)
noisy code.
Here's a quick example:
var person = new Person {FirstName = "Jose", LastName = "Gonzalez"};
<Html> | |
<head> | |
</head> | |
<body> | |
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> | |
<script> | |
// reg JS | |
<!-- axios('http://megaman-robot-masters.herokuapp.com/') --> | |
<!-- .then(function (response) { --> |
// From | |
// https://fsharpforfunandprofit.com/posts/low-risk-ways-to-use-fsharp-at-work-2/#dev-website-responding | |
//This script checks that a website is responding with a 200. | |
//This might be useful as the basis for a post-deployment smoke test | |
#r @"..\Packages\FSharp.Data\lib\net40\FSharp.Data.dll" | |
open FSharp.Data |
//https://fsharpforfunandprofit.com/posts/low-risk-ways-to-use-fsharp-at-work-2/#dev-rss-to-csv | |
System.IO.Directory.SetCurrentDirectory (__SOURCE_DIRECTORY__) | |
#r @"..\Packages\FSharp.Data\lib\net40\FSharp.Data.dll" | |
#r "System.Xml.Linq.dll" | |
open FSharp.Data | |
type Rss = XmlProvider<"http://stackoverflow.com/feeds/tag/elm"> |
// You need Fsharp providers. More info at: http://fsharp.github.io/FSharp.Data/ | |
#r @"..\Packages\FSharp.Data\lib\net40\FSharp.Data.dll" | |
open FSharp.Data | |
[<Literal>] | |
let uri = @"https://en.wikipedia.org/wiki/Doctor_Who" | |
type DoctorWhoData = HtmlProvider<uri> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> |
#r @"..\Packages\FSharp.Data\lib\net40\FSharp.Data.dll" | |
open System | |
open System.IO | |
open System.Web | |
open System.Net | |
open FSharp.Data | |
type Robot = JsonProvider<"http://megaman-robot-masters.herokuapp.com/"> |