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
| class Greeter { | |
| constructor(public greeting: string) { } | |
| greet() { | |
| return "<h1>" + this.greeting + "</h1>"; | |
| } | |
| }; | |
| var greeter = new Greeter("Hello, Ministry of Programming!"); | |
| var str = greeter.greet(); |
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 translations = { | |
| translationOne: 'hello world', | |
| translationTwo: 'hello {{world}}', | |
| translationThree: "hello {{world}}, I'm {{name}}!", | |
| translationFour: '{{foo}} has a {{bar}}', | |
| } as const; | |
| type Translations = typeof translations; | |
| type InterpolateInner< | |
| S extends string, |
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
| // Available variables: | |
| // - Machine | |
| // - interpret | |
| // - assign | |
| // - send | |
| // - sendParent | |
| // - spawn | |
| // - raise | |
| // - actions |
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 playerMachine = Machine({ | |
| id: 'player', | |
| initial: 'boot', | |
| context: { | |
| playbackState: undefined | |
| }, | |
| states: { | |
| boot: { | |
| on: { | |
| RESOLVE: { target: 'initialized'}, |
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 React, { useState, useEffect, useRef } from "react"; | |
| const TimerFunction = ({ minutes, seconds }) => { | |
| const [min, setMin] = useState(minutes); | |
| const [sec, setSec] = useState(seconds); | |
| const [active, setActive] = useState(false); | |
| const intervalRef = useRef(); | |
| useEffect(() => { | |
| setMin(minutes); |
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 React, { useState } from "react"; | |
| // import StartStopTimer from "./StartStopTimer"; | |
| import Timer from "./TimerFunction"; | |
| const Clock = () => { | |
| const [minutes, setMinutes] = useState(0); | |
| const [seconds, setSeconds] = useState(0); | |
| const [submittedMinutes, setSubmittedMinutes] = useState(0); | |
| const [submittedSeconds, setSubmittedSeconds] = useState(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
| {selectedMenus[depth] === label && ( | |
| <SidebarItem.List depth={depth}> | |
| {children.map((child, i) => { | |
| const { label } = child; | |
| const childDepth = depth + 1; | |
| return ( | |
| <SidebarItem | |
| link={child} | |
| handleMenuSelection={handleMenuSelection} | |
| key={`child-${label}-${i}`} |
NewerOlder