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.

Enhancement suggestion: Multiple instances of the same module

See original GitHub issue

Hello,

Not a bug but a feature suggestion, managing several pages (MMM-pages) on my magic mirror, I find the need to have a module behaving differently on the different pages (eg large display on the home screen, compact mode in another)

In the forums, a recurrent solution is to clone the modules to a different module directory with a different name, fiddle with the js/css file name and possibly other files depending on the module. Not really satisfactory as updating the module as it evolves becomes cumbersome.

I was thinking of something like

		{
			module: "text-clock-homescreen",
			moduleOnFile: "MMM-text-clock",
			position: "middle_center",
			config: {
				compact: false,
				size: "large",
				language: ['jp','fr','en','es'],
				languageAlternationInterval: 10
			}
		}, 
		{
			module: "text-clock-compact",
			moduleOnFile: "MMM-text-clock",
			position: "top_center",
			config: {
				compact: true,
				size: "medium",
				language: ['jp','fr','en','es'],
				languageAlternationInterval: 10
			}
		}, 

I haven’t looked at the internals of MagicMirror but just wanted to run this by the active community to see if this made sense at all to others or had already been considered and discarded.

Happy to contribute to this of course.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
pierrephicommented, Feb 10, 2021

Thanks @michmich was right it work out of the box with classes in MMM-pages I’ve got it up and running now 😃

0reactions
sdetweilcommented, Feb 10, 2021

it really is up to the module to implement support for multiple instances. not hard, but does require some coding change

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using the same assignment in two different modules
Hi,. I'm using a Canvas class from another teacher and notice that the same assignment is used across more than one module.
Read more >
Multiple instances of same custom module on landing page
What I need to be able to do is on any given landing page, that is using a template with flexible columns, be...
Read more >
Are multiple store instances supported? · Issue #414 - GitHub
I have createStore method which returns a new store instance. Since the modules also need to be unique per instance, I'm cloning them...
Read more >
Instance-Aware Vuex Modules - Part 3 - Matt Brophy
In Part 2 we covered the usage of dynamic route-based Vuex modules, the issues with map* helpers, and how we can work around...
Read more >
Haskell: How to put multiple instances in the same module?
Consider two libraries, each of which define an instance of class C for type T. Both instances are in internal modules not exposed...
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