Skip to content

Instantly share code, notes, and snippets.

View AmirTugi's full-sized avatar

Amir Tugendhaft AmirTugi

View GitHub Profile
export const ToastTheme: ComponentMultiStyleConfig = {
parts: ['container', 'icon', 'action', 'content'],
type: { // 1. This is not supported by th `ComponentStyleConfig` type
info: { // 2. Who will handle the assigning to `theme.type[props.type]`?
container: {} // 3. Who will handle the `theme.type[props.type][part]`?
}
},
variants: {
default: {} // This is b
}
import { Component, Input, Output, EventEmitter, OnInit, OnChanges, SimpleChanges } from '@angular/core';
import { CategoryModel } from './category/model';
import { Observable } from 'rxjs';
import { CategoryQuery } from './category/store.query';
import { CategoryStoreService } from './category/store.service';
export type SearchEvent = { searchTerm: string, selectedCategory: CategoryModel};
@Component({
selector: 'app-search',
@AmirTugi
AmirTugi / category--api.service.ts
Last active March 16, 2019 09:28
Independent Search Component Akita Store
import { Injectable } from '@angular/core';
import { categoriesMock } from './categories-mock';
import { of } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class CategoryApiService {
search() {
return of(categoriesMock)
function purchasePizzaIngredients<P>() {
return {
purchaseToppings: (toppings: ExtractToppings<P>) => {},
};
}
type ExtractToppings<P> = P extends Pizza<infer T, any> ? T : never;
type MargheritaToppings = {
mushrooms?: boolean;
olives?: boolean;
onion?: boolean;
basil?: boolean;
};
type MargheritaCheeses = {
mozzarella?: boolean;
parmesan?: boolean;
type ExtractToppings<P> = P extends Pizza<infer T> ? T : never;
function purchasePizzaIngredients<P, T>() {
return {
purchaseToppings: (toppings: T) => {},
};
}
type MargheritaToppings = {
mushrooms?: boolean;
olives?: boolean;
onion?: boolean;
basil?: boolean;
};
type HawaiianToppings = {
pineapple?: boolean;
};
import TeaSchool from 'tea-school';
import * as pug from 'pug';
import * as path from 'path';
import {PDFOptions} from 'puppeteer';
import {Options as SassOptions} from 'node-sass';
(async () => {
/********************************
* STYLE OPTIONS *
********************************/