Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 1.33 KB

CONTRIBUTING.md

File metadata and controls

21 lines (16 loc) · 1.33 KB

Please don't use any classes and/or decorators. This maybe makes code readable but hard to test and reason about and isn't quite declarative. Naming things is(should be) much easier.

Take a look for example at composition in http_server.js:

export const processRequest = U.asyncCompose(
  createResponder,
  resolveResponse,
  handleNotFound,
  handleUse,
  tryComposedMiddlewares,
  resolveRequestBody,
  prepareContext,
);

If you want to branch (like applyGetMethod or applyMethod in jsondb.js), please use cond, when and/or ifElse. If a function throws an exception please start the name with throws.

If you want to get/set deeply from/to objects please use lenses.

Ramda or similar library is also fine, it might be integrated in future, but it wasn't exporting properly for Deno at the time of starting to write Tino.