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.

Consider splitting global variables out of config.js and making available to all views

See original GitHub issue

We’ve seen some users want to make some variables available globally to all views. At the moment this is can be cumbersome to do and confusing for people not familiar with js.

One solution would be to automatically make the contents of config.js available to all views. It currently contains some stuff (port number) that you might not want available, so an alternate would be to split the file in to config.js and variables.js, and have the contents of the latter file made available to all views.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
joelanmancommented, Oct 12, 2016

I think maybe config.js and data.js

0reactions
joelanmancommented, Oct 12, 2018

We think this functionality is covered by the default session data - please feel free to reopen if anyone disagrees.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Need advise/help on getting rid of global variables
And I've put all global variables inside settings.js. Currently I use these global variables for these reasons: 1. Calculation based on some ...
Read more >
Allow to share global state between tests from globalSetup
I have seen some really gross workarounds to this problem that abstract the various tests in each testfile into regular js functions, and...
Read more >
3 ways webpack surprises web developers - rossta.net
For this post, we're going to look at three common surprises web developers face when learning webpack: why using global variables doesn't ...
Read more >
Global Variables and States: Why So Much Hate?
Global variables are a common pitfall many developers fall into. Let's take a look why, and how we can fix this problem.
Read more >
Namespacing Fundamentals - Learning JavaScript Design ...
One popular pattern for namespacing in JavaScript is opting for a single global variable as our primary object of reference. A skeleton implementation...
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