Skip to content

Instantly share code, notes, and snippets.

View ogaston's full-sized avatar
🦅
Challenging me

Omar Gaston Chalas ogaston

🦅
Challenging me
View GitHub Profile
interface IAutomobile {
tires: Tire[],
engine: Engine
}
class Car implements IAutomobile {
constructor(public tires: Tire[], public engine: Engine) { }
}
class Tire {
this.setState((state) => {
return { isTurnedOn: !state.isTurnedOn }
})
import React from 'react'
export default function Bulb({ lampState }) {
return lampState ?
(<span>
<img src={'https://cdn2.iconfinder.com/data/icons/flat-icons-19/512/Light_bulb.png'} width={50} />
</span>) :
(<span>
<img src={'https://img.icons8.com/ios/1600/light-on.png'} width={50} />
</span>)
import React from 'react'
import Bulb from 'Bulb'
export default class Lamp extends React.Component {
constructor(props) {
super(props)
this.state = {
isTurnedOn : false
}
}
import React from 'react'
import Lamp from 'Lamp'
class App extends React.Component {
render() {
return (
<Lamp />
);
}
}
@ogaston
ogaston / classComponent.js
Created January 10, 2019 20:38
A react class component (basic example)
class Lamp extends React.Component {
constructor(props) {
super(props)
this.state = {
isTurnedOn : false
}
}
switchLight = () => {
this.setState({
@ogaston
ogaston / app.component.html
Created December 18, 2017 14:34
Proyect BankApp
<!DOCTYPE html>
<html>
<head>
<title>Club de Compras</title>
<!--<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">-->
</head>
<body>
<mat-toolbar color="default">