Skip to content

Commit

Permalink
Fixes liferay#1330 - Rename data to dataSource
Browse files Browse the repository at this point in the history
  • Loading branch information
matuzalemsteles committed Dec 4, 2018
1 parent b2dc075 commit cebd197
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/clay-data-provider/src/ClayDataProvider.js
Expand Up @@ -27,7 +27,10 @@ class ClayDataProvider extends ClayComponent {
this._handleDataChange();
}

timeout(this.requestTimeout, fetch(this.data, this.requestOptions))
timeout(
this.requestTimeout,
fetch(this.dataSource, this.requestOptions)
)
.then(res => res.json())
.then(res => {
this._dataSource = res;
Expand Down Expand Up @@ -107,8 +110,8 @@ class ClayDataProvider extends ClayComponent {
created() {
this._isResolvedData = false;
this._pollingInterval = 0;
if (this._hasData(this.data)) {
this._dataSource = this.data;
if (this._hasData(this.dataSource)) {
this._dataSource = this.dataSource;
this._isResolvedData = true;
} else {
this._fetchData();
Expand Down Expand Up @@ -192,7 +195,7 @@ ClayDataProvider.STATE = {
* @memberof ClayDataProvider
* @type {!(string|object|array)}
*/
data: Config.oneOfType([
dataSource: Config.oneOfType([
Config.array(),
Config.object(),
Config.string(),
Expand Down

0 comments on commit cebd197

Please sign in to comment.