Ale*_*lov 5 javascript serialization parsing json asynchronous
在我的react-native应用程序中,我需要stringify(序列化)大对象而不是阻塞js线程 - 使用另一个线程的异步api,如下所示:
JSON.stringifyAsync({ foo: "bar" }).then(x => console.log(x));
Run Code Online (Sandbox Code Playgroud)
请不要建议将JSON.stringify包装到Promise中,它只是推迟阻塞js线程.
| 归档时间: |
|
| 查看次数: |
656 次 |
| 最近记录: |