async await Promise.all

async getaaa() async getbbb() async getccc() =======new way======= async refreshall(){ await Promise.all( xxxxxx.map(async (value, index) =>{ aaa = await getaaa() })) await Promise.all( xxxxxx.map(async (value, index) =>{ bbb = await getbbb() })) await Promise.all( xxxxxx.map(async (value, index) =>{ ccc = await getccc() })) } =======old way======= async refreshall(){ await Promise.all( xxxxxx.map(async (value, index) =>{ aaa = await getaaa() bbb = await getbbb() ccc = await getccc() })) } 1. map usually return something, here just throw 2. if use foreach(), get error. Like foreach is not function, can’t async await. ...

2018-05-24 · 1 min · 111 words · Me

call by value call by reference object array push

Problem: array A A.push(item) item is object from for or map or foreach….etc show A all add item is same……. Solve: var txxxxx = [] // xxxx is any word =====loop start===== txxxx[index] = item //index is from for or map or foreach…etc ot = { xxxx: txxxx[index] } A.push(ot) =====loop end=====

2018-05-23 · 1 min · 52 words · Me

vue watch v-for

Very easy things, but need some way to pass this difficult. Problme is async await if your problem is this, now see how to do 1. template or web html .any input v-model=“filter_keywork” . {{r.aaa}} {{r.bbb}} 2. var app data:{ filer_keywork: ‘’, resuls: [], } 3. methods:{ getrows(){ this.axios or any http get }, async filteredRows(){ this.results = await this.getrows() } } 4.watch: { filter_keywork: function(){ this.filteredRows() } } Watch filter_keywork changed to call method this.fileredRows(). ...

2018-05-23 · 1 min · 97 words · Me

[轉]區塊鍊 blockshain bitcoin ethereum

非常好的說明 Block https://www.youtube.com/watch?v=_160oMzblY8 https://anders.com/blockchain/ https://www.inside.com.tw/2018/05/16/monero-hard-fork-success

2018-05-19 · 1 min · 5 words · Me

[轉]Golang 交叉编译跨平台的可执行程序 (Mac、Linux、Windows )

https://www.jisec.com/application-development/753.html OS ARCH OS version linux 386 / amd64 / arm >= Linux 2.6 darwin 386 / amd64 OS X (Snow Leopard + Lion) freebsd 386 / amd64 >= FreeBSD 7 windows 386 / amd64 >= Windows 2000 go env Mac 下编译 Linux 和 Windows 64位可执行程序 CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go Linux 下编译 Mac 和 Windows 64位可执行程序 CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build main.go CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build main.go ...

2018-05-18 · 1 min · 100 words · Me