ENMAP V6 PRE-RELEASE ALPHA
If you use this, don't.
V5 => V6
The biggest changes in V6 is that the cache is removed, any method that previously only worked on cached data will now work on all data.
Enmap can no longer be initialised with an iterable - adding values in enmap must be done
using the various set methods, not during initialisation.
All array loop methods (map, foreach, filter, find, reduce, etc) no longer have the 3rd argument, so they are no longer "identical to array methods".
This is partially because this used to be all the cached values, but in reality, it's also because you're using these methods on an enmap, so why would
you need access to the enmap inside those callbacks? However, each of those callbacks return an Array, not an enmap, so you can then use the regular array methods.
Renamed or alias removed
These methods still exist but have been renamed, and all duplicates deleted. No aliases remain, but it should be easy to just rename these in your code.
Pay attention to the fact that some properties are now methods (.indexes
is now .keys()
)
length
, count
=> size
indexes
=> keys()
deleteAll
=> clear()
array()
=> values()
keyArray()
=> keys()
exists
=> has()
with a path
Removed due to deprecation
These have been deprecated for several minor versions, as they aren't used, or useful, in the context of Enmap.
setProp, pushIn, getProp, deleteProp, removeFrom, hasProp
: removed as the "path" in methods replaces them.
partition
: easily replaced with client code using .reduce()
equals
: Would be extremely intensive done right. Check keys()
equivalence or use loops yourself!defer
: hasn't been relevant for a while since better-sqlite3 was added. No promises in Enmap!findAll
: can easily be replaced with a normal find() and function.
Deleted as no longer relevant
Since there is no longer currently a cache in Enmap, all these are completely irrelevant at this point.
If a cache is added as an option or middleware later, these options will be part of that new feature.
- fetch()
- fetchEverything()
- evict()
- changed()
- options.fetchAll
- options.autoFetch
- options.polling
- options.pollingInterval
- options.cloneLevel
Migration todo list
This is the initial support list for Enmap v5 methods being "ported" to the new V6 infrastructure.
My initial support is only for internal use, if you're reading this, do not use enmap v6 right now
First list is for implementation without path support.
Database-specific
Array Methods
Map methods
Extra Stuff
Todo List - Prop Support
Todo List - More