タグ

関連タグで絞り込む (1)

タグの絞り込みを解除

es6に関するyo_wakaのブックマーク (10)

  • ES6 generators in depth

    This blog post is outdated. Please read chapter “Generators” in “Exploring ES6”. This blog post is part of a series on iteration in ES6: Iterables and iterators in ECMAScript 6 ES6 generators in depth Generators, a new feature of ECMAScript 6 [1], are functions that can be paused and resumed. This helps with many applications: iterators, asynchronous programming, etc. This blog post explains how g

    yo_waka
    yo_waka 2015/04/01
  • Using ECMAScript 6 today

    This blog post is outdated. Read my book, instead (free online!): “Exploring ES6” ECMAScript 6 (ES6) still sounds like something from the future. After all, it will only become a standard by mid 2015. However, its features are continually appearing in browsers and there are compilers that translate ES6 code to ES5 code. The latter is already a compelling solution, because the ECMAScript 6 feature

    yo_waka
    yo_waka 2015/03/17
  • No promises: asynchronous JavaScript with only generators

    Two ECMAScript 6 [1] features enable an intriguing new style of asynchronous JavaScript code: promises [2] and generators [3]. This blog post explains this new style and presents a way of using it without promises. Overview  # Normally, you make a function calls like this: let result = func(···); console.log(result); It would be great if this style of invocation also worked for functions that perf

    yo_waka
    yo_waka 2015/03/17
  • いぇーい yield と co と koa

    express の後継だけあって期待が高まってる Koa ですが、あの珍妙な yield による同期処理っぽい記述がどのようにして支えられているかメモってみます。 年末年始を経てヤル気が高まってきたので、久々にnodeの話。 visionmedia/co さて題。 早速ですが、koa の middleware における、あの特徴的な yield 天国は、koa ではなく co というモジュールによるものです。サンプルを見るのが早いです。 件は yield を使うので、現時点では node v0.11.x を --harmony オプション付き実行が必要なことに注意してください 下記は co を単品で利用した場合のサンプルです。 /** * GETリクエストを非同期処理するモジュールを想定 * @example get('http://example.com')(function() {

    いぇーい yield と co と koa
    yo_waka
    yo_waka 2015/03/17
  • ES6 Generatorを使ってasync/awaitを実装するメモ - maru source

    こんにちは丸山@h13i32maruです。 ES6のGeneratorを勉強する題材としてasync/awaitを実装してみたので、そのメモです。 Genratorとは ES6のGeneratorとは「任意の時点で処理を中断/再開することができる関数」というもの。一般的にはコルーチン(coroutine)と呼ばれるもので、サブルーチン(通常の関数)を一般化したもの。ES6でGeneratorを理解するには3つのキーワードがある。 Generator Function 処理の中断/再開が行われる特殊な関数 function* generatorFunction(){}のようにfunction*を使って定義する Generator Object 中断された処理を再開したり、値を取得し対するオブジェクト var generatorObject = generatorFunction()のように取

    ES6 Generatorを使ってasync/awaitを実装するメモ - maru source
    yo_waka
    yo_waka 2015/03/17
  • ECMAScript 6 proxyによるメタプログラミング(3/11) | JSお散歩

    yo_waka
    yo_waka 2015/03/10
  • Using ES6 Today!

    Using ES6 Today! R. Mark Volkmann Object Computing Inc. mark@ociweb.com based on an article at http://sett.ociweb.com/sett/settApr2014.html Copyright © 2014 by Object Computing, Inc. (OCI). All rights reserved. Using ES6 Today ECMAScript Defined by European Computer Manufacturers Association (ECMA) Specification is called ECMAScript or ECMA-262 JavaScript 5.1 (ES5) - http://www.ecma-international.

    yo_waka
    yo_waka 2014/08/04
  • Promiseについて - JS.next

    概要 Promiseとは非同期処理を上手く扱う為のAPIであり、パターンである。 非同期の処理の完了後に続けて処理を行いたいとき、よくコールバックパターンが使われるが、処理が連続するとコールバック地獄と言われる分かりづらいソースコードになってしまう。 また、複数の非同期処理が完了した時に処理を行うなど、コールバックパターンでは難しい事をスマートにできるのがこのPromiseである。 今まではDOMの方でDOM Promiseとして仕様策定が進められていたり、ライブラリのDeferredが有名だったが、ES2015標準に入ることになり、V8に実装された。 実装されたメソッド Promise.resolve(x) Promise.reject(x) Promise.all( [p1, p2, p3, ......] ) Promise.race( [p1, p2, p3, ......] )

    Promiseについて - JS.next
  • ECMAScript 6 modules in future browsers

    Update 2013-11-22: David Herman has published the slide deck “Status Report: ES6 Modules”. [1] is an introduction to ECMAScript 6 modules and how they can be used in current browsers. In contrast, this blog post explains how future browsers will support them natively. As part of that support, we will get the <module> tag, a better version of the <script> tag. Browsers: asynchronous modules, synchr

  • authoring yui modules using ES6

    What is this? This is a gist to showcase how can we get yui modules authored using ES6 module syntax and then getting them transpile into various formats, including AMD, CommonJS and YUI.add. Why ES6 for authoring yui modules Inter-operability Contextualization by removing the needs of a common namespace and focus on exports instead. Better control of the isolated units that can be required/used p

    authoring yui modules using ES6
  • 1