"Shared" data across multiple instances of a plug-in element

It’d be great if there was a convenient way for multiple instances of a plug-in to access shared data on a page - i.e. something analogous to instance.data but for “class” data - maybe something like context.class or context.shared (since the context object is already available to action and state initialization functions).

My needs are pretty basic right now - i.e. just sharing constants across instances of a plug-in on a page - but I can see other potential uses, such as simple “inter-instance” communication.

If there’s already a way to do this without resorting to page-level globals, I’d love to know about it.

1 Like