Archive of stories published by Frochu

讓你的Action能作更多 — Redux-Thunk

延續著自己寫的Redux Middleware大略架構,接下來要來介紹Redux-Thunk。本篇除了介紹Redux-Thunk在作些什麼外,也希望能稍微review React-Thunk中的原始碼(因為很短?)。

首先,何謂thunk?問問維基百科吧!

In computer programming, a thunk is a subroutine that is created, often automatically, to assist a call to another…

別這樣使用Promise

聲明:本篇文章摘要Promises: All The Wrong Ways

錯誤的開始

假設個情境:當你從其他函式庫引用foo()時,而回傳一個promise,問題來了,要如何肯定你使用的promise是你所想的那個promise嗎?例如開發者在先前使用了Bluebird promises(或其他promise-like api),但此時引用的foo()所回傳的promise呢?

These were the top 10 stories published by Frochu; you can also dive into yearly archives: 2016, 2017, 2018, 2019, 2020, and 2022.

About
Frochu
Frochu — Frontend Ochu ,程式碼的黑手,親手實作的前端知識推動者
More information
Tags
Editors