liam

Results 16 issues of liam

hi,it‘s a nice solution for micro frontends with ssr, do there have a plan for supporting js sandbox and css isolation

hi, i set viewportWidth: 375 and then run in the phone 6 simulator whose width is exactly 375, then i set **font-size: 16px**, but end up in 5vw, the right...

**Is your feature request related to a problem? Please describe.** Hi, we are using js entry for a micro frontend project, but may collect css source while the entry bundling...

wontfix

Hi, this PR is mainly to solve the problem when choosing `js file` as project entry especially in a `Micro Frontend Project` And the source code is inspired by `html-webpack-plugin`...

### 顺序发送 4 个请求 a,b,c,d,要求按照顺序输出 利用数组缓存,再按照标志依次输出 ```js function getData(urls) { // 感谢 @jinxin0112 的指正 return new Promise((resolve, reject) => { const res = [], len = urls.length; urls.forEach((url, i) =>...

面经

### 用 promise 实现一个请求超时功能 **关键词:promise.then 与 setTimeout 并行** 抓住 promise 的状态只能由 pending -> fulfilled,或者 pending -> rejected,并且只能进行一次改变 ```js function promiseWithTimeout(url, timeout = 3000) { return new Promise((resolve, reject) => {...

面经

### 格式化数字 **要求:使用正则和非正则两种方式实现** 评论区大神们,欢迎附上正则版~ ```js // 法1:toLocaleString // 浏览器提供该 api 对数字进行格式化,不过对于小数的处理使用的是四舍五入 let num = 1234567; console.log(num.toLocaleString('en-US')); // 1,234,567 num = 12345.6785; console.log(num.toLocaleString('en-US')); // 12,345.679 // 法2:数组操作 function format(num) { if...

面经

### 实现简易版 MVVM **关键词:Object.defineProperty** ```js class Observer { constructor(data) { this.data = data; } observe(prop, cbObj) { // 调用了 observe 才会对属性 prop 进行观察 if (!prop || typeof prop !== 'string')...

面经

[原文地址](https://github.com/lawler61/blog/blob/master/js/mobx-source/index.md) 欢迎讨论~

mobx 源码解读

### 手撸一个事件机制 **关键词:发布-订阅模式** 其实核心就是维护一个对象,对象的 key 存的是事件 type,对应的 value 为触发相应 type 的回调函数,即 listeners,然后 trigger 时遍历通知,即 forEach 进行回调执行。 ```js class EventTarget { constructor() { this.listeners = {}; // 储存事件的对象 } on(type, callback)...

面经