Ole Ersoy

Image by Pexels from Pixabay

Scenario

Have have the following Typescript class instances:

class DateClass {
constructor(public name: string, public receiptDate: Date) {}
}
const d1 = new DateClass('d1', new Date(3));
const d2 = new DateClass('d2', new Date(2));
const arr: DateClass[] = [d1, d2];

And we wish to sort them in the following order:

[d2, d1]

Approach

Image by Peggychoucair from Pixabay

Scenario

We’ve created a new client for our Google Social application login and we need to update the client credentials for the application.

Approach

From the root of the project run:

amplify auth update
What do you want to do? Update OAuth social providers
Select the identity providers you want to configure…

Image by Pexels from Pixabay

Scenario

We have a RANGE_DEFAULT_OPTIONS object:

const RANGE_DEFAULT_OPTIONS = { min: 0, max: 100 }

And we want to use the defaults, unless the API overrides them:

export function range(value:number, options:any) {
...
}

Approach

options = { ...RANGE_DEFAULT_OPTIONS, ...options }

Demo