(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
import {Injectable} from 'angular2/core'; | |
import {Http} from 'angular2/http'; | |
import {Observable} from 'rxjs/Observable'; | |
import 'rxjs/add/operator/map'; | |
const GITHUB_API_URL = 'https://api.github.com'; | |
export class Repository { | |
name: string; | |
full_name: string; |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
import { Store, Action, ofType } from '@ngrx/store'; | |
import { catchError } from 'rxjs/operators'; | |
import { of } from 'rxjs/observable/of'; | |
import { switchMap, map } from 'rxjs/operators'; | |
export class EffectError implements Action { | |
readonly type = '[Error] Effect Error'; | |
} | |
@Injectable() |
invoices/123
?
in a URL like /assignments?showGrades=1
.#
portion of the URL. This is not available to servers in request.url
so its client only. By default it means which part of the page the user should be scrolled to, but developers use it for various things.any
: magic, ill-behaved type that acts like a combination of never
(the proper [bottom type]) and unknown
(the proper [top type])
any
, and any
is assignable to anything at all.any & AnyTypeExpression = any
, any | AnyTypeExpression = any
unknown
: proper, well-behaved [top type]
unknown
. unknown
is only assignable to itself (unknown
) and any
.unknown & AnyTypeExpression = AnyTypeExpression
, unknown | AnyTypeExpression = unknown
any
whenever possible. Anywhere in well-typed code you're tempted to use any
, you probably want unknown
.function configureStoreWithFeature(feature: ...): Provider[] { | |
return [ | |
{ | |
provide: Store, | |
useFactory: () => { | |
const rootStore = inject(RootStore); | |
for (const feature of inject(STORE_FEATURE, [])) { | |
rootStore.registerFeature(feature); | |
} | |
return rootStore; |
import { ComponentRef, createComponent, Type } from "@angular/core"; | |
import { createApplication } from "@angular/platform-browser"; | |
import React, { useEffect, useRef, useState } from "react"; | |
type AnyComponentRef = ComponentRef<unknown>; | |
export type ReactifyProps = { | |
component: Type<unknown>; | |
inputs?: Record<string, unknown>; | |
}; |