A developer should be able to register configuration such as the API’s base URL in a single place and jsonmonger should use that information when needed. The best solution for this is to create a singleton object that keeps a canonical configuration object with this information.
This object should also be used for registering every custom Model per-type, so that related records can be automagically included as Model objects.
A developer should be able to register configuration such as the API’s base URL in a single place and
jsonmonger
should use that information when needed. The best solution for this is to create a singleton object that keeps a canonical configuration object with this information.This object should also be used for registering every custom Model per-type, so that related records can be automagically included as
Model
objects.Ref: https://derickbailey.com/2016/03/09/creating-a-true-singleton-in-node-js-with-es6-symbols/