@financial-times/dotcom-server-navigation 7.1.0 → 7.1.3

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.
@@ -38,7 +38,8 @@ class Navigation {
38
38
  async getMenusData() {
39
39
  // initialPromise does not return data but must resolve before `getData` can be called
40
40
  await this.initialPromise;
41
- return this.poller.getData();
41
+ this.menuData = this.poller.getData();
42
+ return this.menuData;
42
43
  }
43
44
  async getMenusFor(currentPath, currentEdition = 'uk') {
44
45
  const menusData = await this.getMenusData();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/dotcom-server-navigation",
3
- "version": "7.1.0",
3
+ "version": "7.1.3",
4
4
  "description": "",
5
5
  "main": "dist/node/index.js",
6
6
  "types": "src/index.ts",
@@ -19,10 +19,10 @@
19
19
  "author": "",
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@financial-times/dotcom-types-navigation": "^7.1.0",
22
+ "@financial-times/dotcom-types-navigation": "^7.1.3",
23
23
  "@types/deep-freeze": "^0.1.1",
24
24
  "deep-freeze": "0.0.1",
25
- "ft-poller": "^5.0.0",
25
+ "ft-poller": "^7.2.1",
26
26
  "http-errors": "^1.7.1",
27
27
  "node-fetch": "^2.2.1"
28
28
  },
package/src/navigation.ts CHANGED
@@ -40,6 +40,7 @@ export class Navigation {
40
40
  public options: TNavOptions
41
41
  public poller: Poller
42
42
  public initialPromise: Promise<void>
43
+ private menuData: TNavMenus
43
44
 
44
45
  constructor(options: TNavOptions = {}) {
45
46
  this.options = { ...defaults, ...options }
@@ -56,7 +57,11 @@ export class Navigation {
56
57
  async getMenusData(): Promise<TNavMenus> {
57
58
  // initialPromise does not return data but must resolve before `getData` can be called
58
59
  await this.initialPromise
59
- return this.poller.getData()
60
+
61
+ this.menuData = this.poller.getData()
62
+
63
+ return this.menuData
64
+
60
65
  }
61
66
 
62
67
  async getMenusFor(currentPath: string, currentEdition: string = 'uk'): Promise<TNavMenusForEdition> {