In Meteor, using an object (defined in one file) in another file without global scoping? -


i've got prices.js file shoppingcartcontents object defined in file.

i'd access shoppingcartcontents object inside helpers.js file, using create global helper.

i can setting shoppingcartcontents global, don't want that. there better way? according docs there's package scope , file scope. these 2 scopes don't seem granular enough me (there's package export feature i'm doing inside 1 package)

things can scoped to:

  • one , 1 file

  • the entire package

shouldn't there file export feature maybe?

if you're working inside package, make variable global. way can access in files, package.

if want global variable, have explicitly export it, there's no problem in using globals.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -