crudit icon indicating copy to clipboard operation
crudit copied to clipboard

Settings loading

Open zeppaman opened this issue 2 years ago • 0 comments

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):

  1. 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"
        });
  1. shortucut. wrapper of the above, but passing parameters in the method variables
credit.XXX(arg1,arg2.arg.3);

//example
crudit.mutation( "xxx", ()=>{}, "xxx");
  1. 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

zeppaman avatar Jan 16 '23 16:01 zeppaman