Updated Version

Scenario

control:FormControl = new FormControl('steak-0')
  • Receive reactive notifications from control.valueChanges
  • Have the mat-select default value be steak-0

Approach

import { Component, VERSION } from "@angular/core";
import { FormControl } from "@angular/forms";
interface Food {
value: string;
viewValue: string;
}
@Component({ selector: "my-app", templateUrl: "./app.component.html", styleUrls: ["./app.component.css"] }) export class AppComponent…

Image by Mitchell Raman from Pixabay

Updated Version

Scenario

Approach

import { Component, OnInit } from '@angular/core'; import { SVG } from '@fireflysemantics/assets' import {…

Image by colbicrook5 from Pixabay

Updated Version

Scenario

  • @fireflysemantics/forecasting
  • @fireflysemantics/optimization

Approach


Image by Jop Verduin from Pixabay

Updated Version

Scenario

Approach

"scripts": {
"ig": "npm install -g @jsdevtools/version-bump-prompt"
}
"scripts": {
...
"bp": "bump patch"
}

Image by GUILHERME BERNARDO from Pixabay

Updated Version

Scenario

export interface ErrorTypes {
[key: string]: string;
}
errorTypes: ErrorTypes = {
NETWORK_ERROR: "Network Error",
DATA_ERROR: "Data Error"
};

Image by Pexels from Pixabay

Updated Version

Scenario

Approach

<ul>   
<li *ngFor="let customer of customers$ | async; index as i">
{{ customer.name }}
</li>
</ul>

Image by tarakko from Pixabay

Updated Version

  • Transaction Data
  • A cryptographic hash ( fingerprint / signature ) of it’s content
  • A nonce value ( A random number used for cryptographic computation )
  • The hash of the previous block
  • A time stamp of a recent verified transaction
import { SHA256 } from "crypto-js";
import { nanoid } from "nanoid";
class Block { constructor( public index: number, public timestamp: string, public…


Image by Friedrich Frühling from Pixabay

Scenario

this.s.os.S.CSV_DATA.obs.subscribe(data=>console.log(data))

Approach

npm i @ngneat/until-destroy
@UntilDestroy()
@Component({
...
})
this.s.os.S.CSV_DATA.obs.pipe(untilDestroyed(this)).subscribe(...)

Image by Foto-Rabe from Pixabay

Scenario

Approach

oops.pipe(catchError(err => of('OOOPS')))

Demo

let catchMeIfYouCan: Observable<string> = throwError("Catch me if you can");catchMeIfYouCan.subscribe(() => console.log("Next handler will not execute"),e => console.log(e),() => console.log("Completion handler will not execute"));

Image by Ronny Overhate from Pixabay

Scenario

Approach

/**
* Redirect the user to the application
* when the user is authenticated.
* @param route
*/
public onAuthRedirectToApplication(route:string) {this.s.OS.S.IS_AUTHENTICATED.obs.subscribe(auth => {
auth && this.r.navigate([route])
})
}

Ole Ersoy

Founder of Firefly Semantics Corporation

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store