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 {Bip39, Random} from "@cosmjs/crypto"; | |
| const generateMnemonic = () => Bip39.encode(Random.getBytes(16)).toString() | |
| console.log(generateMnemonic()) | |
| /** | |
| * Generates (your own Mnemonic) a 16-word recovery phrase that can be used to recover a private key |
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 item1 from '../fixtures/example-1-item-1.json' | |
| it('Should show functioning log & copy buttons', () => { | |
| cy.visit('/', { | |
| onBeforeLoad(win) { | |
| cy.stub(win.console, 'log').as('consoleLog') | |
| cy.stub(win.console, 'info').as('consoleInfo') | |
| cy.stub(win.console, 'error').as('consoleError') | |
| cy.stub(win.navigator.clipboard, 'writeText').as('write') | |
| } |
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
| # SUPPORT OUR REPOSITORY [earn solana](https://www.botheredotters.com/?ref=4y52SoLdrgx3pCLqdUxiB699sEnQucfHFhEXviuUwpPu) | |
| ___ | |
| CryptoForSpeed https://sweepwidget.com/view/37077-r7ed60bx/iixvhj-37077 |
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
| references: | |
| cypress: &circleci_image | |
| circleci/node:latest-browsers | |
| working_directory: &working_directory | |
| ~/tmp | |
| aliases: | |
| - &deploy_environment | |
| docker: | |
| - image: *circleci_image |
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
| version: 2 | |
| jobs: | |
| build: | |
| working_directory: ~/tmp | |
| docker: | |
| - image: circleci/node:latest-browsers | |
| environment: | |
| TERM: xterm | |
| steps: |
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
| interface IUser { | |
| name: string; | |
| email: string; | |
| age: number; | |
| isMarried: boolean; | |
| } | |
| const fetchData = (apiUrl: string): Promise<IUser> => { | |
| return fetch(apiUrl) | |
| .then((response)=> response.json()) |
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 fetchData = (apiUrl) => { | |
| return fetch(apiUrl).then((response)=> response.json()); | |
| }; | |
| const data = fetchData("awesomeApi.com/data/subscribe"); | |
| console.log(data.name); | |
| console.log(data.email); | |
| console.log(data.age); | |
| console.log(data.isMarried); |
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
| // https://learn.javascript.ru/promise-chaining | |
| // Запрашиваем user.json | |
| fetch('/article/promise-chaining/user.json') | |
| // Загружаем данные в формате json | |
| .then(response => response.json()) | |
| // Делаем запрос к GitHub | |
| .then(user => fetch(`https://api.github.com/users/${user.name}`)) | |
| // Загружаем ответ в формате json | |
| .then(response => response.json()) |
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
| // define a Navigation Link type for our links | |
| export type NavLinkPropType = { | |
| label: string; | |
| route: string; | |
| }; | |
| const AppHeaderNavLink: React.FC<NavLinkPropType> = ({ label }) => { | |
| return <span className="nav-link">{label}</span>; | |
| }; |
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
| /** | |
| * error: "Binding element 'name' implicitly has an 'any' type.ts(7031)" | |
| **/ | |
| // BEFORE | |
| export function Heading ({name}){ | |
| return <h1>Your {name}</h1> | |
| } |
NewerOlder