Angular: Resource APIファミリーの体系図
DRANK
この記事では、Angular v22で安定版となったResource APIファミリーについて、その関係を概観する。Resource APIファミリーv22時点で Resource API に含まれる主要な公開APIは次のものである。Resource<T> インターフェースWritableResource<T> インターフェースResourceSnapshot<T> インターフェースresourceFromSnapshots 関数resource 関数httpResource 関数これらのAPIをひとつずつ解説しながら、APIファミリー内での位置づけを確認していこう。Resource<T> インターフェースこのインターフェースはAPIファミリーの中心にある。Resource APIファミリーは大きく分けて、Resourceオブジェクトを表すAPI群と、Resourceオブジェクトを作成するためのファクトリーAPI群とに分けられる。Resource<T> インターフェースはResourceオブジェクトすべてに共通する基底型であり、ファクトリーAPIの戻り値になる型でもある。export interface Resource<T> { readonly value: Signal<T>; readonly status: Signal<ResourceStatus>; readonly error: Signal<Error undefined>; readonly isLoading: Signal<boolean>; readonly snapshot: Signal<ResourceSnapshot<T>>; has…
1 comments
書いた! "Angular: Resource APIファミリーの体系図 | lacolaco's marginalia" blog.lacolaco.net/posts/angular-… #laco_feed