TypeScript の Promise の型 だと、型パラメータが Promise#then 側しかなくて、 Promise#catch 側の型が any になってしまって不便だ。 もし、catch 側の型についても型引数で指定できたなら、より安全なプログラミングができる。 そこで、catch 側の型を指定していない理由について考察してみた。 理想 const promise: IdealPromise<T, E> = getPromise(); promise .then((x) => { /* x は T 型 */ }); promise .catch((e) => { /* e は E 型 */ }); 実際 const promise: Promise<T> = getPromise(); promise .then((x) => { /* x は T 型 */ }); prom
2016-05-24(火)19:30 - 21:30 https://html5j-begin.doorkeeper.jp/events/36265
Mixed Content Mixed Contentと言う仕様により、httpsで提供しているページの中でhttpで提供するリソース(script等)があるとそのリソースはブロックされます。 このMixed Contentには、Content Security Policyのblock-all-mixed-contentディレクティブも定義されています Content-Security-Policy: block-all-mixed-content このディレクティブは、scriptなどのBlockable Contentだけでなく、画像や動画といったOptionally-blockable Contentもブロックするようにするためのディレクティブです。 このblock-all-mixed-contentの仕様にレポート機能が追加された模様(間違い等あればご指摘下さい violatio
This is a live document. Last update: 08/17/2016 as of 2.0.0-rc.2 General Notes A checked item means it has been implemented in the 2.0 development branch. Features subject to change during development. The breaking change list is not guaranteed to be complete during development. There are some upgrade tips at the end. High Level Changes The template parser no longer relies on the DOM (unless you
Offline Web Applications This specification highlights features (SQL, offline application caching APIs as well as online/offline events, status, and the localStorage API) from HTML5 and provides brief tutorials on how these features might be used to create Web applications that work offline. Service Workers This specification describes a method that enables applications to take advantage of persis
In this tutorial, we'll walk through how to build a React component that uses the Google Maps API. Integrating React with external libraries like Google or Facebook APIs can be confusing and challenging. In this discussion, we'll look at how to integrate the Google Maps API with React. In this post we'll deal with lazily-loading the library through building complex nested components. This post is
Jake Archibald on Instant Loading: Building offline-first Progressive Web Apps For most of the web, poor network connectivity destroys the user experience. We can do better. In this session we'll take an online-only site and turn it into a fully network-resilient, offline-first installable progressive web app, and this won't involve rebuilding from scratch; it'll be done in small iterations, wit
In this blog post, I show six tricks enabled by new ES6 features. At the end of each section, I point to related material in my book “Exploring ES6” (which is free to read online). Enforcing mandatory parameters via parameter default values # ES6 parameter default values are only evaluated when they are actually used. That lets you enforce that a given parameter be provided: /** * Called if a par
The simple example of calculating and formatting a bill for a video store opened my refactoring book in 1999. If done in modern JavaScript, there are several directions you could take the refactoring. I explore four here: refactoring to top level functions, to a nested function with a dispatcher, using classes, and transformation using an intermediate data structure. 18 May 2016 Many years ago, wh
Last week I wrote about the yield return statement in c# and how it allows for deferred execution. In that post I explained how it powers LINQ and explained some non-obvious behaviors. In this week’s post I want to do the same thing but for Javascript. ES6 (ES2015) is becoming more and more mainstream, but in terms of usage I mostly see the more common arrow-functions or block-scoping (with let an
A tiny library for building modular UI components using DOM diffing and ES6 tagged template literals, powered by bel and morphdom and based on the "yo-yo" data binding pattern: data down, actions up. yo-yo powers the choo framework, you should check it out if you want something higher level! or if you want lower level, see the module that powers yo-yo: bel Getting started is as easy as var element
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く