mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
add info about global variables
This commit is contained in:
@@ -32,9 +32,10 @@ export default defineConfig({
|
||||
{
|
||||
text: "API Changes",
|
||||
items: [
|
||||
{text: "Using Async Functions", link: "/api/async-functions"},
|
||||
{text: "Global Variables", link: "/api/global-variables"},
|
||||
{text: "Renamed Functions", link: "/api/renamed-functions"},
|
||||
{text: "Removed Functions", link: "/api/removed-functions"},
|
||||
{text: "Using Async Functions", link: "/api/async-functions"},
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
7
v3-docs/v3-migration-docs/api/global-variables.md
Normal file
7
v3-docs/v3-migration-docs/api/global-variables.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Global Variables
|
||||
|
||||
On apps, instead of using `GlobalVar = { ... }` to define a global variable, you should use `global.GlobalVar = { ... }`.
|
||||
|
||||
Defining globals in **packages** should still work the same as in Meteor 2.
|
||||
|
||||
> For packages, Meteor adds a variable declaration in the package scope, which has the side effect of avoiding this mechanic altogether. In apps, there is no "app scope" so these globals are true globals.
|
||||
Reference in New Issue
Block a user