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
| import 'zone.js'; | |
| import {Component, OnInit } from '@angular/core'; | |
| import {bootstrapApplication} from '@angular/platform-browser'; | |
| import { Observable } from 'rxjs'; | |
| class Counter { | |
| intervalId = -1 | |
| count = 0 |
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
| import { useSortAsc, useSortDesc, useFetch, useAsyncValue, useEvenNumbers } from './hooks.js' | |
| const fetchArrayOfNumbers = async () => { | |
| return new Promise((resolve) => { | |
| setTimeout(() => { | |
| resolve([1, 2, 3, 4, 5, 6, 10]); | |
| }, 1000); | |
| }); | |
| }; |
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
| import { string, object, array, number, boolean } from "typeguard.types" | |
| const schema = array( | |
| object({ | |
| name: string((val) => `${val} doe`), | |
| id: number((val) => val + 1), | |
| birthdate: string((val) => new Date(val).toLocaleDateString("pt-br")), | |
| ready: boolean(), | |
| parents: array( | |
| object({ |
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
| import XboxController from "./xbox-controller"; | |
| export const XBOX_GAMEPAD_KEY = 'xbox' | |
| /** | |
| * @returns An `Map` of all connected gamepads. | |
| */ | |
| async function scanGamepads() { | |
| let controllers = new Map(); |