diff options
author | Alexey Kiryushin <alexey.a.kiryushin@gmail.com> | 2018-11-16 16:19:03 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-16 16:19:03 +0300 |
commit | 866bfff6ff41a2796329c6bb28db688cbfeed2b8 (patch) | |
tree | 3da173b79af7727969116df212fba597fbddc3a3 /javascript/app/services | |
parent | b5a3048a880c8ce1c2bfa795a39576d02f416be2 (diff) |
Add cross-package 'find references'
Diffstat (limited to 'javascript/app/services')
-rw-r--r-- | javascript/app/services/store.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/javascript/app/services/store.js b/javascript/app/services/store.js index cf48f9d..8001061 100644 --- a/javascript/app/services/store.js +++ b/javascript/app/services/store.js @@ -52,6 +52,7 @@ export default Ember.Service.extend({ this.modulePaths = {}; this.expressions = {}; this.references = {}; + this.globalReferences = {}; }, loadPackage(packageId) { const packageInfo = this.packages[packageId]; @@ -137,5 +138,17 @@ export default Ember.Service.extend({ linkHeader:linkHeader }; }); - } + }, + loadGlobalReferences(externalId) { + const globalReferences = this.globalReferences[externalId]; + if(globalReferences) { + return new RSVP.Promise((resolve) => {resolve(globalReferences);}); + } else { + const url = urls.globalReferencesUrl(externalId); + return Ember.$.getJSON(url).then((refs) => { + this.globalReferences[externalId] = refs; + return refs; + }); + } + }, }); |