From cd1255c670764783021ee80f2578a98902aa9f96 Mon Sep 17 00:00:00 2001 From: Tobe O Date: Sun, 21 Oct 2018 04:53:09 -0400 Subject: [PATCH] Refactor --- lib/src/core/hooked_service.dart | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/src/core/hooked_service.dart b/lib/src/core/hooked_service.dart index e6cc202b..cfc2ad0d 100644 --- a/lib/src/core/hooked_service.dart +++ b/lib/src/core/hooked_service.dart @@ -276,7 +276,7 @@ class HookedService> ._emit(new HookedServiceEvent(true, _getRequest(_params), _getResponse(_params), inner, HookedServiceEvent.indexed, params: params, result: before.result)) - .then((after) => after.result); + .then((after) => after.result as List); } return inner.index(params).then((result) { @@ -284,7 +284,7 @@ class HookedService> ._emit(new HookedServiceEvent(true, _getRequest(_params), _getResponse(_params), inner, HookedServiceEvent.indexed, params: params, result: result)) - .then((after) => after.result); + .then((after) => after.result as List); }); }); } @@ -302,7 +302,7 @@ class HookedService> ._emit(new HookedServiceEvent(true, _getRequest(_params), _getResponse(_params), inner, HookedServiceEvent.read, id: id, params: params, result: before.result)) - .then((after) => after.result); + .then((after) => after.result as Data); } return inner.read(id, params).then((result) { @@ -310,7 +310,7 @@ class HookedService> ._emit(new HookedServiceEvent(true, _getRequest(_params), _getResponse(_params), inner, HookedServiceEvent.read, id: id, params: params, result: result)) - .then((after) => after.result); + .then((after) => after.result as Data); }); }); } @@ -328,7 +328,7 @@ class HookedService> ._emit(new HookedServiceEvent(true, _getRequest(_params), _getResponse(_params), inner, HookedServiceEvent.created, data: data, params: params, result: before.result)) - .then((after) => after.result); + .then((after) => after.result as Data); } return inner.create(data, params).then((result) { @@ -336,7 +336,7 @@ class HookedService> ._emit(new HookedServiceEvent(true, _getRequest(_params), _getResponse(_params), inner, HookedServiceEvent.created, data: data, params: params, result: result)) - .then((after) => after.result); + .then((after) => after.result as Data); }); }); } @@ -354,7 +354,7 @@ class HookedService> ._emit(new HookedServiceEvent(true, _getRequest(_params), _getResponse(_params), inner, HookedServiceEvent.modified, id: id, data: data, params: params, result: before.result)) - .then((after) => after.result); + .then((after) => after.result as Data); } return inner.modify(id, data, params).then((result) { @@ -362,7 +362,7 @@ class HookedService> ._emit(new HookedServiceEvent(true, _getRequest(_params), _getResponse(_params), inner, HookedServiceEvent.created, id: id, data: data, params: params, result: result)) - .then((after) => after.result); + .then((after) => after.result as Data); }); }); } @@ -380,7 +380,7 @@ class HookedService> ._emit(new HookedServiceEvent(true, _getRequest(_params), _getResponse(_params), inner, HookedServiceEvent.updated, id: id, data: data, params: params, result: before.result)) - .then((after) => after.result); + .then((after) => after.result as Data); } return inner.update(id, data, params).then((result) { @@ -388,7 +388,7 @@ class HookedService> ._emit(new HookedServiceEvent(true, _getRequest(_params), _getResponse(_params), inner, HookedServiceEvent.updated, id: id, data: data, params: params, result: result)) - .then((after) => after.result); + .then((after) => after.result as Data); }); }); } @@ -406,7 +406,7 @@ class HookedService> ._emit(new HookedServiceEvent(true, _getRequest(_params), _getResponse(_params), inner, HookedServiceEvent.removed, id: id, params: params, result: before.result)) - .then((after) => after.result); + .then((after) => after.result) as Data; } return inner.remove(id, params).then((result) { @@ -414,7 +414,7 @@ class HookedService> ._emit(new HookedServiceEvent(true, _getRequest(_params), _getResponse(_params), inner, HookedServiceEvent.removed, id: id, params: params, result: result)) - .then((after) => after.result); + .then((after) => after.result as Data); }); }); }