@zodash/onion
Advanced tools
Comparing version 0.0.9 to 0.0.11
@@ -6,2 +6,18 @@ # Change Log | ||
## [0.0.11](https://github.com/zcorky/zodash/compare/@zodash/onion@0.0.10...@zodash/onion@0.0.11) (2019-11-25) | ||
**Note:** Version bump only for package @zodash/onion | ||
## 0.0.10 (2019-11-25) | ||
**Note:** Version bump only for package @zodash/onion | ||
## [0.0.9](https://github.com/zcorky/zodash/compare/@zodash/onion@0.0.8...@zodash/onion@0.0.9) (2019-10-30) | ||
@@ -8,0 +24,0 @@ |
@@ -16,3 +16,3 @@ import { Middleware } from '@zodash/compose'; | ||
} | ||
export declare class Onion implements IOnion { | ||
export declare abstract class Onion implements IOnion { | ||
private middlewares; | ||
@@ -22,2 +22,3 @@ private handler; | ||
use(middleware: Middleware<Context>): this; | ||
abstract handle(): Middleware<Context>; | ||
callback(): (input: Input, output: Output) => Promise<any>; | ||
@@ -24,0 +25,0 @@ execute(input: Input): Promise<Output>; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
@@ -22,2 +23,3 @@ }); | ||
if (!this.handler) { | ||
this.use(this.handle()); | ||
const fn = compose_1.compose(...this.middlewares); | ||
@@ -24,0 +26,0 @@ this.handler = fn; |
{ | ||
"name": "@zodash/onion", | ||
"version": "0.0.9", | ||
"version": "0.0.11", | ||
"description": "simple onion model", | ||
@@ -70,4 +70,3 @@ "keywords": [ | ||
"@zodash/compose": "^0.0.7" | ||
}, | ||
"gitHead": "af20ebc946f1ddf379a410ab1694036490139169" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
7161
74