ruiming

Results comments of ruiming

@Julyrainy 一次事件循环只执行一次宏任务(task), 然后执行多个微任务(microtask). 这个是浏览器端的事件循环模型, 不适用于 nodejs. 我之前也在关于 nodejs 的事件循环看到这种说法, 这个是错误的. 关于浏览器端的事件循环可以参考 https://html.spec.whatwg.org/multipage/webappapis.html#event-loops . 如果楼主有兴趣的话, 不妨也翻译下.

我尝试修改 `connect` 的 type definition,可以看下这个: https://github.com/dvajs/dva/compare/master...ruiming:patch-1 但是这样做会有新的问题,`connect` 无法使用装饰器语法 `@connect`,总是会提示不匹配,这个问题似乎还无解(https://github.com/DefinitelyTyped/DefinitelyTyped/issues/19020)。 但不适用装饰器语法的话,像下面这样写的,是可以正常工作的并正确检查 Props(只检查 IOwnProps): ```typescript export default connect( mapStateToProps, mapDispatchToProps )(LogTable) ```

@yvanwangl 嗯,我之前用 Antd 的 `@Form.create()` 也是不能用,最后也是像你这样做解决的。 你说的第二点,这样做会丢失使用该组件时的 OwnProps 属性的静态检查吧?你可以参考我最上面"实际效果"的代码,通过 connect 的泛型支持是可以处理这个问题的。

@yvanwangl 但这样你这个组件对使用者而言,用没用 TypeScript 都一样了,没有了补全和静态检查。我不是很认可这种写法。不过确实麻烦了点,获取 mapStateToProps 的返回值类型还要通过污染运行时来实现。

@ouabing 可以先试着直接用 Redux 的 connect 而不是 dva 的。另外 TS 已经有了 returnType 运算符了,我前面的 demo 太啰嗦了。

Can I still use the "Source Han Sans" or "思源黑体" name if I transform the font to woff/woff2 type? > No Modified Version of the Font Software may use the...

I have the same problem. This work for me: ```typescript export class ICreateOrUpdateActivity implements IActivity { @IsString() title: string @ValidateNested() @Type(() => ICreateOrUpdateActivityPrize) prizes: ICreateOrUpdateActivityPrize[] @ValidateNested() @Type(() => ICreateOrUpdateActivityReply) replies:...

@pleerock Would't it result in dirty write in some situation?

This is what I want. Thanks.