Releases: Qix-/scaly
Releases · Qix-/scaly
1.0.1
1.0.0
Major Release 1.0.0
This is the first major release of Scaly, which has been used in production in moderate workloads for the better part of a year now.
Changes from latest scaly@<1
version
- Adds Typescript type definitions (#1)
- Brings XO up to date
Using Typescript
import scaly, {ScalyResult} from 'scaly';
// or
import {scaly, ScalyResult} from 'scaly';
const layer1 = {
async *getUsername(id: number): ScalyResult<string> {
return "Junon";
}
};
const layer2 = {
async *getUsername(id: number): ScalyResult<string> {
console.log('CACHE: user', id, 'has username', yield);
}
};
const api = scaly(layer2, layer1);
api.getUsername(0).then(result => console.log('RESULT:', result));
Migrating from scaly@<1
- Layers are now passed as splats, not as arrays. This was done to facilitate Typescript definitions.
-scaly([layer1, layer2, layer3])
+scaly(layer1, layer2, layer3)
Thank you to @dylan1p for the feedback and testing throughout the last year, and @rainandwind0 for hallway testing the concepts and ideas and interface alongside me.