Jaguar-dart / client

Contains various packages for client side
46 stars 22 forks source link

Add multiple interceptors, the interceptor After method input error #64

Open androidhaha opened 4 years ago

androidhaha commented 4 years ago

The input parameter of each interceptor is the original data, not the data processed by the previous interceptor

`AsyncStringResponse resp = AsyncStringResponse(

AsyncStringResponse.from(cloned._send(), sender: this, sent: cloned) .then((StringResponse r) async { StringResponse ret = r; for (After func in cloned.getAfter) { ///The input parameter here should be ret,not r var res = await func(r); if (res is StringResponse) ret = res; } return ret; }));`