npx serve --corsThen make reference to the main.mjs in an import statement
| node_modules/ | |
| dist/ | |
| package-lock.json |
| # http://editorconfig.org | |
| # Match with prettier.config.js AND .gitattributes | |
| root = true | |
| [*] | |
| charset = utf-8 | |
| end_of_line = lf | |
| indent_size = 2 | |
| indent_style = space |
This is originally copy-pasted from bennadel’s Gist and this article, which looks good, but I wanted it to be usable independently from Angular.
Roughly, it'll need setupEventBinding to be broken up where we'd tell we need to bind such and such. We'd probably end up using native directly though.
| // config.ts | |
| import { join, resolve } from 'path' | |
| import { default as convictFactory, Schema } from 'convict' | |
| import dotenv from 'dotenv' | |
| import { AppConfigSchema } from './types' | |
| import { convict, maybeFilePath } from './utils' |
Quoting [We should not forget the await (Exploring ECMASCript 2016-2017; 5.3.1 Don’t forget await][public-book-exploring2016-17-async-do-not-forget-await])
[
outvalue] is set to aPromise, which is usually not what you want in async functions.awaitcan even make sense if an async function doesn’t return anything.
| /** | |
| * EXTRA: | |
| * Étant donné que et que la question demande une "solution idiomatique" et | |
| * que je crains que je n'ai aucune expérience avec les langages donnés et | |
| * que je me sens limité à exprimer avec la bonne syntaxe ma réponse, | |
| * j'ai décidé d'ajouter cet extra. | |
| * | |
| * Je me permet donc ici de fournir une version sommaire d'un gestionnaire de | |
| * connection qui permet de supporter plus d'un vendeur. | |
| * |
| From dd22508d45c9a839d26a090bba05e62abe41e492 Mon Sep 17 00:00:00 2001 | |
| From: Renoir Boulanger <contribs@renoirboulanger.com> | |
| Date: Thu, 4 Jun 2020 10:25:15 -0400 | |
| Subject: [PATCH] Just-a-Demo | |
| --- | |
| .gitignore | 2 ++ | |
| package.json | 39 +++++++++++++++++++++++++++++++++++++++ | |
| src/index.ts | 25 +++++++++++++++++++++++++ | |
| tsconfig.json | 14 ++++++++++++++ |
| /* eslint-disable @typescript-eslint/ban-ts-ignore */ | |
| /** | |
| * File: src/tokenizer.ts | |
| */ | |
| import co from 'co' | |
| const TOKENIZER_END = Symbol('TOKENIZER_END') |