@apollo-elements/mixins
Advanced tools
Comparing version 1.1.3 to 1.2.0
@@ -52,2 +52,5 @@ import { ApolloElement } from "./apollo-element-mixin"; | ||
public subscribeToMore(options: SubscribeToMoreOptions<TData, TVariables, TSubscriptionData>): () => void; | ||
public onData?(result: ApolloQueryResult<TData>): any; | ||
public onError?(error: ApolloError): any; | ||
} | ||
@@ -54,0 +57,0 @@ |
@@ -320,2 +320,3 @@ import { ApolloElementMixin } from './apollo-element-mixin.js'; | ||
this.stale = stale; | ||
this.onData({ data, loading, networkStatus, stale }); | ||
} | ||
@@ -331,3 +332,18 @@ | ||
this.error = error; | ||
this.onError(error); | ||
} | ||
/** | ||
* Callback for when a query is completed. | ||
* | ||
* @abstract | ||
*/ | ||
onData() {} | ||
/** | ||
* Callback for when an error occurs in mutation. | ||
* | ||
* @abstract | ||
*/ | ||
onError() {} | ||
}; |
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.2.0](https://github.com/apollo-elements/apollo-elements/compare/@apollo-elements/mixins@1.1.3...@apollo-elements/mixins@1.2.0) (2020-01-09) | ||
### Features | ||
* **mixins:** add onData, onError to ApolloQuery ([0a34e00](https://github.com/apollo-elements/apollo-elements/commit/0a34e00)), closes [#42](https://github.com/apollo-elements/apollo-elements/issues/42) | ||
## [1.1.3](https://github.com/apollo-elements/apollo-elements/compare/@apollo-elements/mixins@1.1.2...@apollo-elements/mixins@1.1.3) (2020-01-09) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "@apollo-elements/mixins", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"description": "👩🚀🌛 Custom Element class mixins for Apollo GraphQL 🚀👨🚀", | ||
@@ -36,3 +36,3 @@ "main": "index.js", | ||
}, | ||
"gitHead": "554e356237b727314c3d4dcc7be8012c30db1757" | ||
"gitHead": "3a278c351a6091ece00a5f7eafa921444d5b7c1f" | ||
} |
79171
1778