question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pass values for `data` and `cache` through options

See original GitHub issue

In ajax.js declared ajax function:

function ajax(url, options, callback, data, cache) {

I don’t see a way to pass data and cache parameters from outside. It would be handy for adding build version:

backend: {
  // add build version to reset browser cache
  loadPath: '{{ns}}/translation_{{lng}}.json'
  data: { v: buildVersion }
}

Could be implemented like this:

function ajax(url, options, callback, data, cache) {
  data = data || options.data;
  cache = cache || options.cache;

  // Must encode data
  if(data && typeof data === 'object') {
  ...

Currently I add parameters likes this:

backend: {
  // add build version to reset browser cache
  loadPath: '{{ns}}/translation_{{lng}}.json?v=' + buildVersion,
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
nikolay-borzovcommented, Mar 19, 2017

I can’t push my branch for some reason. I will try to fight it tomorrow. Otherwise I will just post gist with my changes

0reactions
jamuhlcommented, Mar 21, 2017

merged

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reading and writing data to the cache - Apollo GraphQL Docs
Watched queries can control what happens when they're invalidated by updates to the cache, by passing options like fetchPolicy and nextFetchPolicy to client....
Read more >
The Cache API: A quick guide - web.dev
To open a cache, use the caches.open(name) method, passing the name of the cache as the single parameter. If the named cache does...
Read more >
Read-Through, Write-Through, Refresh-Ahead and Write ...
In this scenario, the application can control when updated values in the cache are written to the data store. The most common use...
Read more >
What is Caching and How it Works | AWS
Caching allows you to efficiently reuse previously retrieved or computed data. How does Caching work? The data in a cache is generally stored...
Read more >
Cache for Top-Level Integration Procedure Data
When you test an Integration Procedure that uses top-level caching in the Preview tab, you can use two caching settings in the Options...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found