摘要:
Let's say we have a web component: import { getProductById } from "../services/Menu.js"; import { addToCart } from "../services/Order.js"; export defa 阅读全文
摘要:
// memento.js import { TodoList } from "./classes.js"; export const TodoHistory = { history: [], push(state) { if (state) { // always push a new Set t 阅读全文
摘要:
Refer to: https://stately.ai/docs/actor-model What defines an “actor”? Actors are independent “live” objects that can communicate with each other via 阅读全文
摘要:
Problem to Solve Reparesent a value that is immutable and distinct from other objects based on its properties rather than its identity. Solution Creat 阅读全文
摘要:
Problem to Solve Share functionality between classes without using inheritance. Solution Create a class containing methods that can be used by other c 阅读全文
摘要:
One of the interesting things about verbatimModuleSyntax in TypeScript is that it requires a specific type of import when you're working with types. L 阅读全文
摘要:
To fix the CommonJS export issue, we need to make a change to our tsconfig.json file. Add the verbatimModuleSyntax setting and set it to true: { "comp 阅读全文
摘要:
The module and moduleResolution options in the tsconfig.json file can be confusing. Here we'll discuss the differences between the module and moduleRe 阅读全文