Skip to content

Instantly share code, notes, and snippets.

Avatar
🙃
implementing and fixing bugs

Michael Hladky BioPhoton

🙃
implementing and fixing bugs
View GitHub Profile
View acii-marbles.md

Confusing

  • ( and ) count as frame
describe('`(` and `)`', () =>  {
  let testScheduler: TestScheduler;

  beforeEach(() => {
    testScheduler = new TestScheduler(observableMatcher);
  });
View step-by-step-demo.md

Reactive Forms

In this section we will learn the basics of reactive forms in angular. We will learn how to set reactive forms up, use built-in validators and display validation errors.

Before we start there are some things to know. Ractive forms are fully functional without any HTML. All of the form depending logic is placed in the conponent as code and not in the template. This make our html very easy to read and edit. We can move parts of the HTML without break form related logic.

View copy-files.ts
import * as fs from 'fs-extra';
import * as path from 'path';
import { bindNodeCallback, concat, Observable, from } from 'rxjs';
import { map } from 'rxjs/operators';
export function globCopy(
patterns: string[],
dir: string
): Observable<{patterns: string[], num: number}> {
return bindNodeCallback(copy)(patterns, dir)
@BioPhoton
BioPhoton / Reactive-Angular-Terminology.md
Last active Dec 17, 2020
List of used terms related to reactivity in context of Angular and their description
View Reactive-Angular-Terminology.md

Reactive Angular Terminology

To have a common terminology I list some of the used terms here and explain their meaning and usage.

Used terms:

  • Asynchronous/Observable Primitive
  • Reactive Primitives
  • Primitive Reactive Problems
  • Bind
  • Connect
View Decision on message format in the deprecation documentation in code.md

Decision on message format in the deprecation documentation in code

As we need to decide on the message format (i.e. It's important if we focus on linter or docs), I create a component that lets you test the message in many different places.

View migration-timeline-maintenance.md
@BioPhoton
BioPhoton / migration-timeline-deprecation-code-examples.md
Last active Jul 31, 2020
Migration Timeline - Deprecation Code Examples
View migration-timeline-deprecation-code-examples.md

Deprecations and their breaking change

Deprecations

The information about a certain deprecation in the library also includes the version when the breaking change will happen as well as code examples for the usage before and after the deprecation.

This snippets are presented as highlited text in the migration timeline and also open up the code in StackBlitz. To provide maintainable code examples we can use version range specifier to let StackBlitz automatically install new versions until the version of the breaking change.

View myChannel.js
.config('myEvents', function() {
valueChanged : 'valueChanged'
});
.service('myChannel', function($rootScope, myEvents) {
var publishValueChanged = function (newVlaue) {
var args = {value: newVlaue};
$rootScope.$emit(myEvents.valueChanged, args);
};