Redux學習
Redux是一個非常好的狀態管理器。
Promise
在使用promise時,如果使用new實例化一個Promise對象,傳遞的參數是一個函數,這時這個函數在new實例化時就已經執行了,這是需要引起注意的細節。所以,我們在使用Promise的時候一般是包在一個函數中,在需要的時候去運行這個函數。
const handleFn = function() {
return new Promise((resolve, reject) => {
...
resolve('success');
...
reject('error');
});
}
git的使用
cherry-pick
想要檢索抽離出某個測試分支中的一個commit(版本ID爲xxxxxxxxx)到生產的分支production上,就要使用到cherry-pick這個命令。
查看所有的分支 git branch -a
切換到遠程的production分支 git checkout origin/production
在這個production分支上新建一個本地分支 git checkout -b new_branch
將要提升的分支版本ID提到該分支上 git cherry-pick xxxxxxxxx
查看提交歷史 git log
這時可以看到那個版本已經在提交歷史中了
推送到遠程倉庫 git push origin new_branch