@dhis2/app-runtime
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -315,3 +315,4 @@ 'use strict'; | ||
const makeCustomContext = (customData, { | ||
failOnMiss = true | ||
failOnMiss = true, | ||
loadForever = false | ||
} = {}) => { | ||
@@ -336,2 +337,6 @@ const apiUrl = joinPath(baseUrl, 'api', String(apiVersion)); | ||
const foreverLoadingFetch = async query => { | ||
return new Promise(() => {}); // Load forever | ||
}; | ||
const context = { | ||
@@ -341,3 +346,3 @@ baseUrl, | ||
apiUrl, | ||
fetch: customFetch | ||
fetch: loadForever ? foreverLoadingFetch : customFetch | ||
}; | ||
@@ -344,0 +349,0 @@ return context; |
@@ -308,3 +308,4 @@ import React, { useContext, useState, useEffect } from 'react'; | ||
const makeCustomContext = (customData, { | ||
failOnMiss = true | ||
failOnMiss = true, | ||
loadForever = false | ||
} = {}) => { | ||
@@ -329,2 +330,6 @@ const apiUrl = joinPath(baseUrl, 'api', String(apiVersion)); | ||
const foreverLoadingFetch = async query => { | ||
return new Promise(() => {}); // Load forever | ||
}; | ||
const context = { | ||
@@ -334,3 +339,3 @@ baseUrl, | ||
apiUrl, | ||
fetch: customFetch | ||
fetch: loadForever ? foreverLoadingFetch : customFetch | ||
}; | ||
@@ -337,0 +342,0 @@ return context; |
{ | ||
"name": "@dhis2/app-runtime", | ||
"description": "A singular runtime dependency for applications on the DHIS2 platform", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"main": "build/cjs/index.js", | ||
@@ -20,3 +20,3 @@ "module": "build/es/index.js", | ||
"@babel/preset-env": "^7.4.3", | ||
"@dhis2/app-service-data": "^1.1.0", | ||
"@dhis2/app-service-data": "1.2.0", | ||
"loop": "^3.1.3", | ||
@@ -23,0 +23,0 @@ "rollup": "^1.9.0", |
18762
591