Closed nhunzaker closed 7 years ago
Yeah, that seems useful, especially the web socket use case. I think I'd use it.
Probably need to make an 11.0 release for this. We have some funkiness around function arity to figure out if a Domain should be mounted at the root or at a key path.
Probably should just make it something like:
// root
repo.addDomain(<null | ''>, Domain, options)
// nested
repo.addDomain('key', Domain, options)
This will land in the next version. We'll ship an 11.0.
I'd like to start playing around with the idea of general purpose domains that could be used for a wide variety of use cases.
For example, on a lot of data visualization prototypes, we have constant values for display properties. Like:
http://code.viget.com/artifacts/09-04-2015-particles/index.html
It's pretty common to use something like DAT GUI to make it configurable. What if we made a domain library that could just do that for us?
https://workshop.chromeexperiments.com/examples/gui/#1--Basic-Usage
The usage could look something like:
Since we have forks now, maybe these could even be additive, applying folders like this:
https://workshop.chromeexperiments.com/examples/gui/#3--Folders
Other use case: Web socket connections
I could see this being useful for web socket connections. Spin up a domain responsible for a connection, have it push actions into a repo maybe. Maybe that's a bad example, but sort of covers the use case I'd like to explore.