Objects with derived indexes!
What does it do?
It creates automatic, synchronous and always-updated "views" for your data. You instantiate a main data object and define functions for creating derived indexes on it. Later you can easily access the data on the derived indexes.
It reduces bloat, verbose value getters and automatizes data organization in the context of your app. Perhaps others would call this "a database". This name would be misleading, but the power of automatic synchronous subindexes cannot be overstated.
(view and fiddle with this example on Tonic)
- The derivation functions are inspired by CouchDB. Not equal, though, but the
emitthing... well, it doesn't matter.
- Other features are planned (please say what would you find more useful):
- immutable main data source
- immutable derived indexes
- queryable derived indexes, returning arrays of values sorted by emitted keys
- derived indexes based on the entire data object, instead of in each of its keys
- derived indexes on sublevels