runNow方法这里有以下文档:
/**
* Executes this callback, on the current thread, right now, blocking until complete.
*
* In most cases, this type is passed to scalajs-react such that you don't need to call this method yourself.
*
* Exceptions will not be caught. Use [[attempt]] to catch thrown exceptions.
*/这有点含糊不清,引出了四个问题:
runNow()的时候?为什么?runNow()的唯一情况是在==>或--> (如描述的这里)中使用回调吗?(我猜这是真的)或者当框架调用runNow()时还有其他情况吗?runNow()?为什么?runNow呢?那会引起什么问题吗?如果是什么?我目前的理解是,可以(甚至需要)将runNow()从一个作为回调传递的scala函数调用到一个包装好的原生JS组件。例如,这里。
不过,我不太清楚。
有人能澄清什么时候可以打电话给runNow(),什么时候不可以吗?
发布于 2017-03-21 09:26:37
我明天会给出一个更详细的答案,但是首先,你读过Callback文档了吗?https://github.com/japgolly/scalajs-react/blob/master/doc/CALLBACK.md
https://stackoverflow.com/questions/42767062
复制相似问题