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.

Define singleton objects

See original GitHub issue

Not everything exists in multiples. In the CMS world there exists objects that are only “singular”. Everything on this page could be defined as one object called HomePage.

rosegardenlandingpage 0 5x

Right now, there is no data structure that represent a HomePage object above. I need to do an ugly hack and make it a list.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:16 (3 by maintainers)

github_iconTop GitHub Comments

10reactions
JedWatsoncommented, May 8, 2016

I’m pretty sure I’ve mentioned this elsewhere, but just to leave a note here as well: This feature is high on the list of things we’ll be addressing once 0.4 is released and stable.

The official implementation will be a streamlined workflow around the hacks that users have already established*, with a specific UI area to make editing singletons easy. We’ll open issues relating to how that’s planned to be implemented (as well as publish the designs we do for how it will work) when it’s coming up for active development.

We feel the pain of not having it (I’ve personally needed it on a few projects) but the call has been to stabilise the new React UI and Field Type components first, which despite the delay (it was a huge amount of work) I think will be the right one in the long term. Migrating data from workaround implementations to the official solution will hopefully be quite straightforward.

* one potential major difference may be that we keep all “singleton” objects in a single MongoDB collection and offload the schema completely to Keystone Lists, rather than wrapping Mongoose Schemas under the hood. Lists have matured a lot in the last few months and I think that’ll be viable, and not having a collection for each singleton is definitely preferable. Again, this will be finalised when the feature is up for development.

4reactions
flzozayacommented, Feb 18, 2018

It’s now been over 1 year and 9 months since @JedWatson commented about this feature. Is there any progress on this??

Read more comments on GitHub >

github_iconTop Results From Across the Web

Singleton pattern - Wikipedia
In software engineering, the singleton pattern is a software design pattern that restricts the instantiation of a class to a singular instance.
Read more >
What is Singleton? - Definition from Techopedia
A singleton is a class that allows only a single instance of itself to be created and gives access to that created instance....
Read more >
What Is a Singleton? - Better Programming
The singleton design pattern restricts the instantiation of a class to a single instance. This is done in order to provide coordinated ...
Read more >
Singleton Objects | Tour of Scala
Defining a singleton object ... An object is a value. The definition of an object looks like a class, but uses the keyword...
Read more >
Singleton Class in Java - GeeksforGeeks
In object-oriented programming, a singleton class is a class that can have only one object (an instance of the class) at a time....
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