@mjhls/mjh-framework 1.0.939-segment-test-v10 → 1.0.939-segment-test-v11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/View.js CHANGED
@@ -507,7 +507,7 @@ var Recommended = function Recommended(props) {
507
507
  // get users traits
508
508
  var getSegmentProfile = function () {
509
509
  var _ref = asyncToGenerator._asyncToGenerator( /*#__PURE__*/asyncToGenerator.regenerator.mark(function _callee() {
510
- var anonymousId, response, data, addTaxonomyName, fetchWithTimeout, favoriteCategories, articlesQuery, videosQuery, podcastQuery, params, _ref2, _ref3, _articles, videos, podcasts;
510
+ var anonymousId, response, data, addTaxonomyName, favoriteCategories, articlesQuery, videosQuery, podcastQuery, params, _ref2, _ref3, _articles, videos, podcasts;
511
511
 
512
512
  return asyncToGenerator.regenerator.wrap(function _callee$(_context) {
513
513
  while (1) {
@@ -529,7 +529,7 @@ var Recommended = function Recommended(props) {
529
529
  data = _context.sent;
530
530
 
531
531
  if (!(data && data.traits && data.traits.favorite_article_category)) {
532
- _context.next = 26;
532
+ _context.next = 25;
533
533
  break;
534
534
  }
535
535
 
@@ -551,21 +551,6 @@ var Recommended = function Recommended(props) {
551
551
  return query;
552
552
  };
553
553
 
554
- fetchWithTimeout = function fetchWithTimeout(timeout, fn) {
555
-
556
- return new asyncToGenerator._Promise(function (resolve, reject) {
557
- // start timeout
558
- var timeoutID = setTimeout(function () {
559
- return resolve([]);
560
- }, timeout);
561
- // start calculation
562
- fn().then(function (result) {
563
- clearTimeout(timeoutID);
564
- resolve(result);
565
- });
566
- });
567
- };
568
-
569
554
  favoriteCategories = JSON.parse(data.traits.favorite_article_category);
570
555
  // grab 3 articles from sanity different from the one currently being read
571
556
 
@@ -575,16 +560,10 @@ var Recommended = function Recommended(props) {
575
560
  params = {
576
561
  id: article._id
577
562
  };
578
- _context.next = 17;
579
- return asyncToGenerator._Promise.all([fetchWithTimeout(3000, function () {
580
- return client.fetch(articlesQuery, params);
581
- }), fetchWithTimeout(2000, function () {
582
- return client.fetch(videosQuery, params);
583
- }), fetchWithTimeout(2000, function () {
584
- return client.fetch(podcastQuery, params);
585
- })]);
586
-
587
- case 17:
563
+ _context.next = 16;
564
+ return asyncToGenerator._Promise.all([client.fetch(articlesQuery, params), client.fetch(videosQuery, params), client.fetch(podcastQuery, params)]);
565
+
566
+ case 16:
588
567
  _ref2 = _context.sent;
589
568
  _ref3 = slicedToArray._slicedToArray(_ref2, 3);
590
569
  _articles = _ref3[0];
@@ -604,13 +583,13 @@ var Recommended = function Recommended(props) {
604
583
  }
605
584
  setArticles(_articles);
606
585
  }
607
- _context.next = 27;
586
+ _context.next = 26;
608
587
  break;
609
588
 
610
- case 26:
589
+ case 25:
611
590
  setLoaded('failed');
612
591
 
613
- case 27:
592
+ case 26:
614
593
  case 'end':
615
594
  return _context.stop();
616
595
  }
package/dist/esm/View.js CHANGED
@@ -496,7 +496,7 @@ var Recommended = function Recommended(props) {
496
496
  // get users traits
497
497
  var getSegmentProfile = function () {
498
498
  var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
499
- var anonymousId, response, data, addTaxonomyName, fetchWithTimeout, favoriteCategories, articlesQuery, videosQuery, podcastQuery, params, _ref2, _ref3, _articles, videos, podcasts;
499
+ var anonymousId, response, data, addTaxonomyName, favoriteCategories, articlesQuery, videosQuery, podcastQuery, params, _ref2, _ref3, _articles, videos, podcasts;
500
500
 
501
501
  return regenerator.wrap(function _callee$(_context) {
502
502
  while (1) {
@@ -518,7 +518,7 @@ var Recommended = function Recommended(props) {
518
518
  data = _context.sent;
519
519
 
520
520
  if (!(data && data.traits && data.traits.favorite_article_category)) {
521
- _context.next = 26;
521
+ _context.next = 25;
522
522
  break;
523
523
  }
524
524
 
@@ -540,21 +540,6 @@ var Recommended = function Recommended(props) {
540
540
  return query;
541
541
  };
542
542
 
543
- fetchWithTimeout = function fetchWithTimeout(timeout, fn) {
544
-
545
- return new _Promise(function (resolve, reject) {
546
- // start timeout
547
- var timeoutID = setTimeout(function () {
548
- return resolve([]);
549
- }, timeout);
550
- // start calculation
551
- fn().then(function (result) {
552
- clearTimeout(timeoutID);
553
- resolve(result);
554
- });
555
- });
556
- };
557
-
558
543
  favoriteCategories = JSON.parse(data.traits.favorite_article_category);
559
544
  // grab 3 articles from sanity different from the one currently being read
560
545
 
@@ -564,16 +549,10 @@ var Recommended = function Recommended(props) {
564
549
  params = {
565
550
  id: article._id
566
551
  };
567
- _context.next = 17;
568
- return _Promise.all([fetchWithTimeout(3000, function () {
569
- return client.fetch(articlesQuery, params);
570
- }), fetchWithTimeout(2000, function () {
571
- return client.fetch(videosQuery, params);
572
- }), fetchWithTimeout(2000, function () {
573
- return client.fetch(podcastQuery, params);
574
- })]);
575
-
576
- case 17:
552
+ _context.next = 16;
553
+ return _Promise.all([client.fetch(articlesQuery, params), client.fetch(videosQuery, params), client.fetch(podcastQuery, params)]);
554
+
555
+ case 16:
577
556
  _ref2 = _context.sent;
578
557
  _ref3 = _slicedToArray(_ref2, 3);
579
558
  _articles = _ref3[0];
@@ -593,13 +572,13 @@ var Recommended = function Recommended(props) {
593
572
  }
594
573
  setArticles(_articles);
595
574
  }
596
- _context.next = 27;
575
+ _context.next = 26;
597
576
  break;
598
577
 
599
- case 26:
578
+ case 25:
600
579
  setLoaded('failed');
601
580
 
602
- case 27:
581
+ case 26:
603
582
  case 'end':
604
583
  return _context.stop();
605
584
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.939-segment-test-v10",
3
+ "version": "1.0.939-segment-test-v11",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",