This file contains 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
class MyComponent extends HTMLElement { | |
function connectedCallback() { | |
this.innerHTML = "<h1>Hello world</h1>"; | |
}} | |
customElements.define('my-component', MyComponent); |
This file contains 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 MainForm() { | |
const pageTitle = useFormInput(''); | |
//as simple as that | |
useEffect(() => { | |
document.title = pageTitle.value; | |
}); | |
return ( |
This file contains 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
constructor() { | |
super(); | |
this.state = { | |
pageTitle: 'React Hooks' | |
}; | |
} | |
handleTitleChange(e) { | |
this.setState({ | |
pageTitle: e.target.value |
This file contains 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 LoginForm() { | |
const name = useFormInput(''); | |
const lastName = useFormInput(''); | |
return ( | |
<div> | |
<div className="form-control"> | |
<TextField label="Name" {...name} /> | |
</div> |
This file contains 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
// state generator | |
function useFormInput(init_value) { | |
const [value, setValue] = useState(init_value); | |
function handleChange(e) { | |
setValue(e.target.value); | |
} | |
return { | |
value, | |
onChange: handleChange | |
} |
This file contains 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
constructor() { | |
super(); | |
this.state = { | |
name: '', | |
lastName: '', | |
pageTitle: 'React Hooks' | |
}; | |
} | |
handleNameChange(e) { |
This file contains 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
build_job: | |
image: runmymind/docker-android-sdk:ubuntu-standalone | |
variables: | |
NODE_VERSION: 8.9.4 | |
stage: build | |
only: | |
- master | |
script: | |
- git submodule update --init --recursive | |
- wget -q http://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz |
This file contains 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 cs: CoursesService, | |
public af: AngularFire, | |
public router: Router |
This file contains 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
<?php ?>z |