タグ

2012年7月27日のブックマーク (2件)

  • Drag and drop a folder onto Chrome now available  |  Blog  |  Chrome for Developers

    As web apps evolve, you might have found it handy to let users drag and drop files from the desktop onto the browser to edit, upload, share, etc. But unfortunately, we’ve been unable to drag and drop folders onto web pages. Luckily, beginning with Chrome 21, this issue will be addressed (already available in the Chrome dev channel). Passing multiple files with drag and drop Let’s look at a code sa

    hatsune-miku
    hatsune-miku 2012/07/27
    あれ、いつの間にかフォルダーをドロップできるようになっていた。
  • JavaScriptでの非同期関数合成 - monjudoh’s diary

    Unserscore.jsや互換ライブラリのLo-Dashを使うと関数合成が出来ます。 複数個の関数があって、関数を呼び出した結果を使って関数を呼び出して…っていうのを1個の関数にします。 ドキュメントの例を見れば分かるかと。 簡略化のために関数合成の対象になる関数を1引数・戻り値ありの関数とします。 これを非同期処理をする関数に当てはめるとcallbackを含む2引数・戻り値なしの関数が当てはまるでしょう。 この場合のcallbackは1引数の関数とします。 まず、logを出力するcallback関数を定義しましょう。 function log(result){ console.log(result); } 次にcallbackを含む2引数・戻り値なしの関数を定義します。別に非同期処理はやっていないです。 // 1を足す function add1(callback,arg){ call

    JavaScriptでの非同期関数合成 - monjudoh’s diary
    hatsune-miku
    hatsune-miku 2012/07/27
    funcs.reduceRightで右から順番にスタックに積んでくイメージで関数が合成される。で、返ってきた合成関数に引数としてargが入る。と思う。やっぱりbindの汎用性って高いな。