nanit
nanit copied to clipboard
Feature request: Determine the load sequence of initializers or finalizers
It would be nice to be able to determine the load sequence of the config files. Take the case of inter-dependencies between configurations.
I'd be interested in hearing about some scenarios where this is needed. I haven't run into this, personally, so the feature was never on my mind.
I've seen other initializer systems do this, though, and never liked the API they created for it. If this is something that nanit needs, we'll want to make sure we get the API right both for readability and for flexibility with other features.
I think just being explicit about how it works is sufficient. So to be extra safe I just added a sort()
and noted that the loaders will run alphabetically in the documentation. This way if there are scenarios where running things in order is needed -- somebody can just name files like 01_run_this_first.js
and rely on that.
( it probably already works this way )