Skip to content

Instantly share code, notes, and snippets.

@FagnerMartinsBrack
Last active February 5, 2019 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FagnerMartinsBrack/0fef5db5d87cd875fabd7d41143ad6fb to your computer and use it in GitHub Desktop.
Save FagnerMartinsBrack/0fef5db5d87cd875fabd7d41143ad6fb to your computer and use it in GitHub Desktop.
(Medium) - Evolvable APIs
// The brains to fill the fields. This uses the human brain of the user.
const usingCLI = (fields) => {
const fieldsWithValuesFromUser = await presentFieldNamesToUser(Object.keys(fields));
return fieldsWithValuesFromUser;
};
// The client uses the CLI to get the field values when the server asks for it
const runWithFieldsFromCLI = run(usingCLI);
// Initial trigger of the booking process
const result = await runWithFieldsFromCLI();
console.log('exit point', result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment