Skip to content

Commit

Permalink
#109. Fix promise with Hoek
Browse files Browse the repository at this point in the history
  • Loading branch information
a.kushman committed May 8, 2018
1 parent c81b811 commit b65e51e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
14 changes: 7 additions & 7 deletions build/index.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ let settings = {
'X-Api-Key': '8013b37216a07f50027139d89ee9f822e3784049',
'X-Header-Key': 'foo-bar'
},
ajax: 'http://gigatables.loc/gigatables.php',
// ajax: new Promise((resolve) => {
// resolve('http://gigatables.loc/gigatables.php')
// }),
// ajax: 'http://gigatables.loc/gigatables.php',
ajax: new Promise((resolve) => {
resolve('http://localhost/gigatables.php')
}),
// ajaxAutoloadData: true, // default false
// ajaxAutoloadPeriod: 8, // sec
requestType: 'GET',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gigatables-react",
"version": "2.4.51",
"version": "2.4.52",
"description": "GigaTables is a ReactJS plug-in to help web-developers process table-data in applications and CMS, CRM, ERP or similar systems. It supports ajax data processing/editing (CRUD), pagination, cross-sorting, global search, shft/ctrl rows selection, 7 popular languages and more.",
"main": "./build/index.js",
"dependencies": {
Expand Down
4 changes: 3 additions & 1 deletion src/Reactables.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ class Reactables extends Main {

resolvePromiseUrl(destination, colsLen) {
if (typeof destination.then === CommonConstants.FUNCTION) {
destination.then((url) => {
// todo: analyze - somehow Promise is broken by Hoek.applyToDefaults(this.defaultSettings, this.props.settings);
const {ajax} = this.props.settings;
ajax.then((url) => {
this.setData(url, colsLen);
});
} else {
Expand Down

0 comments on commit b65e51e

Please sign in to comment.