crudit
crudit copied to clipboard
Settings loading
Managing all items in a single file is hard. The idea is to give three possibility to load each kind of settings (actually are: hooks, entities, requests,mutations).
For each one we must have three different ways for adding settings (image xxx is one of kind mentioned above):
- load object. The method has the key and the data that is stored into the object list.
credit.addXXX({object});
//example
crudit.addMutation({
name: "xxx",
function: ()=>{},
dbName: "xxx"
});
- shortucut. wrapper of the above, but passing parameters in the method variables
credit.XXX(arg1,arg2.arg.3);
//example
crudit.mutation( "xxx", ()=>{}, "xxx");
- shortucut. wrapper of the above, but from file. Each file will contains the export of alist of object to be merge.
credit.loadXXX(path);
path specifications:
- if path is a file load all items inside and merge with settings
- if path is a folder, load all files (each one can contains multiple settings) and append to the configuration object