-
Notifications
You must be signed in to change notification settings - Fork 0
Global References
Brandon Jordan edited this page Oct 29, 2024
·
6 revisions
Spark provides a global map of object references that can be accessed anywhere.
You can define a global reference using define(key, object)
.
const randomX = new RandomStore(0, 0, window.innerWidth);
spark.define('randomX', randomX);
In another part of your application, you can then get the exact same object by reference using ref(key)
.
spark.ref('randomX');