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 from 'react'; | |
| import { appSimulator } from '@tramvai/test'; | |
| import { CommonModule } from '@tramvai/module-common'; | |
| import { | |
| CONTEXT_TOKEN, | |
| REQUEST_MANAGER_TOKEN, | |
| COMPONENT_REGISTRY_TOKEN, | |
| } from '@tramvai/tokens-common'; | |
| import { commandLineListTokens } from '@tramvai/core'; | |
| import { DI_TOKEN } from 'dippy'; |
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 { appSimulator } from '@tramvai/test'; | |
| import { createAction } from '@tramvai/core'; | |
| import { createReducer, createEvent } from '@tramvai/state'; | |
| import { CommonModule } from '@tramvai/module-common'; | |
| import { actionServerStateEvent } from '@tramvai/module-common/lib/actions/actionTramvaiReducer'; | |
| import { CONTEXT_TOKEN, COMBINE_REDUCERS } from '@tramvai/tokens-common'; | |
| const incrementEvent = createEvent('increment'); | |
| const testReducer = createReducer('test', { |
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 { commandLineListTokens } from '@tramvai/core' | |
| import { createToken } from 'dippy' | |
| import { | |
| ENV_MANAGER_TOKEN, | |
| LOGGER_TOKEN, | |
| ENV_USED_TOKEN, | |
| } from '@tramvai/tokens-common' | |
| import jsonServer from 'json-server' | |
| import httpProxy from 'http-proxy' | |
| import { WEB_APP_INIT_TOKEN } from '@tramvai/module-server' |
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
| type Keys<T extends {}> = keyof T; | |
| type Values<T extends {}> = T[keyof T]; | |
| type FilterFlags<Base, Condition> = { | |
| [Key in keyof Base]: Base[Key] extends Condition ? Key : never | |
| }; | |
| type AllowedNames<Base, Condition> = FilterFlags<Base, Condition>[keyof Base]; |
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
| type Keys<T extends {}> = keyof T; | |
| type Values<T extends {}> = T[keyof T]; | |
| type FilterFlags<Base, Condition> = { | |
| [Key in keyof Base]: Base[Key] extends Condition ? Key : never; | |
| }; | |
| type AllowedNames<Base, Condition> = FilterFlags<Base, Condition>[keyof Base]; |
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 assert = require('assert'); | |
| const www = { | |
| 'url1': 'result1', | |
| 'url2': 'result2', | |
| 'url3': 'result3', | |
| 'url4': 'result4' | |
| }; | |
| const fetch = (url, ms = 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
| const assert = require('assert'); | |
| /** | |
| * @param {Array<string>} anagrams | |
| * @returns Array<Array<string>> | |
| */ | |
| function groupAnagrams(anagrams) { | |
| const groups = new Map(); | |
| for (const word of anagrams) { |
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 assert = require('assert'); | |
| /** | |
| * @param {Array<Array<number, number>>} guests | |
| * @returns number | |
| */ | |
| function maxGuests(guests) { | |
| let maxCount = 0; | |
| let currentCount = 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
| const WebSocket = require('ws'); | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const http = require('http'); | |
| const redis = require('redis'); | |
| const redisList = redis.createClient(); | |
| const redisSub = redis.createClient(); | |
| const redisPub = redis.createClient(); |
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 fields = [{ | |
| type: 'input', | |
| placeholder: 'My field №1', | |
| value: '', | |
| onChange: (event) => {}, | |
| }, ...]; // 100 разных полей ввода | |
| const GenerateForm = (props) => ( | |
| <Form onSubmit={props.onSubmit}> | |
| {props.fields.map((field) => ( |