Skip to content

Instantly share code, notes, and snippets.

Zlati Pehlivanov talamaska

  • Bulgaria
Block or report user

Report or block talamaska

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View chips.dart
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
// See:
void main() => runApp(ChipsDemoApp());
talamaska / Dart Class.dart
Created Jan 11, 2019 — forked from buntagonalprism/Dart Class.dart
Flutter and Dart collection of file templates for Android Studio development
View Dart Class.dart
#set( $nameparts = $NAME.split("_"))
#set( $namepart = '')
#set( $classname = '')
#foreach( $namepart in $nameparts )
#set( $classname = $classname + $namepart.substring(0, 1).toUpperCase() + $namepart.substring(1))
class $classname {
// TODO: add class properties and methods
View custom.overlay.config.ts
interface CustomOverlayConfig {
hasBackdropClick?: boolean;
isCentered?: boolean;
size?: any;
top?: string;
const DEFAULT_CUSTOM_CONFIG: CustomOverlayConfig = {
hasBackdropClick: false,
isCentered: true,
View confirmation.modal.ref.ts
import { OverlayRef } from '@angular/cdk/overlay';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import { Subject } from 'rxjs/Subject';
export class ConfirmationModalOverlayRef {
public events = new BehaviorSubject<any>(null);
constructor(private overlayRef: OverlayRef) { }
public close(): void {
talamaska / form.modal.component.ts
Last active Mar 20, 2019
component portal modals
View form.modal.component.ts
this.isSuccessSub = this.isSuccess$.subscribe((isSuccess) => {
if (isSuccess) {
talamaska / loading-spinner.service.ts
Created May 15, 2018 — forked from caroso1222/loading-spinner.service.ts
Angular CDK - Portal and PortalHost
View loading-spinner.service.ts
import {
} from '@angular/core';
import {
talamaska /
Created Feb 20, 2018 — forked from peterbsmith2/
Making chained API Calls using @ngrx/Effects

Making chained API Calls using @ngrx/Effects


This recipe is useful for cooking up chained API calls as a result of a single action.


In the below example, a single action called POST_REPO is dispatched and it's intention is to create a new repostiory on GitHub then update the README with new data after it is created.
For this to happen there are 4 API calls necessary to the GitHub API:

  1. POST a new repostiry
  2. GET the master branch of the new repository
  3. GET the files on the master branch
View line.effect.ts
import { Store, Action } from '@ngrx/store';
import { Actions, Effect } from '@ngrx/effects';
import { ADD_LINE } from './lines.reducer';
import { INC_PAGE_COUNT } from './pages.reducer';
import { AppState } from './';
export class LineEffects {
talamaska / conditional_effects.ts
Created Feb 20, 2018 — forked from vespertilian/conditional_effects.ts
Two options for conditional ngrx effects
View conditional_effects.ts
selectAndLoadStore$: Observable<Action> = this.actions$
.map(([action, storeState]) => [action.payload, storeState])
.switchMap(([storeName, storeState]) => {
const existsInStore = Boolean(storeState.urlNameMap[storeName]);
return Observable.if(
() => existsInStore,
Observable.of(new storeActions.SetSelectedStore(storeName)),
View ngrx-effects-advance-example.js
// Nothing changed here, works as previously.
@Effect() actionX$ = this.updates$
.switchMap(payload => this.api.callApiX(payload)
.map(data => ({type: 'ACTION_X_SUCCESS', payload: data}))
.catch(err => Observable.of({type: 'ACTION_X_FAIL', payload: err}))
You can’t perform that action at this time.