Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Reduce qnt of parameters in Run method in node #432

Closed
danieldrewszup opened this issue Aug 14, 2020 · 1 comment
Closed

Reduce qnt of parameters in Run method in node #432

danieldrewszup opened this issue Aug 14, 2020 · 1 comment
Labels
🔨 improvement Improvement in features

Comments

@danieldrewszup
Copy link

danieldrewszup commented Aug 14, 2020

After creating a new formula in node you can see in index.js a bunch of const definitions for each input parameter defined at config.json being passed as arguments to the Run method. So when is too many?
We can use destructing in ES6 a small example would be that:

index.js
run(process.env)
formula.js
function Run({FOO, BAR}) {}

Improving, whould be nice to have a object and forms to retrieve it (for any type of project). One object called Settings and inside of it we have all possible default configurations for int, string, bool values... And 'forms' of retrieving it already typed. Below you can see a small example in C#:

using(Settings setting = new Settings()) {
	int x = setting['PROPX'].GetInt();
	string y = settin['PROPY'].GetString();
	...
	setting['PROPZ'].SetInt(230);
	...
}
@danieldrewszup danieldrewszup added the 🔨 improvement Improvement in features label Aug 14, 2020
@kaduartur
Copy link
Contributor

Hello @danieldrewszup, can you open an issue in the formula project to edit the formulas templates?

Because the ritchie-cli only sends the environment variables to the formulas.

Thanks for your collaboration!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔨 improvement Improvement in features
Projects
None yet
Development

No branches or pull requests

2 participants