Code Monkey home page Code Monkey logo

submodule's Introduction

Submodule

Principle

Submodule approaches in a rather naive destruction of what component make an application an application.

  1. Submodule starts with loading configFn. You can use whatever you like to build the config object

  2. Submodule then passes the config object to preparedContextFn. Prepared context is the term we use to explain the space where we may store reusable service like Prisma Client, Mongo Client etc.

  3. Once we built the service, we then need to prepare the shape of framework. Nice thing is, Submodule doesn't dictate any specific shape, it is up to your choice to setup your framework. Submodule alos plays nicely with moderating the differences between framework, if you are looking to build a shared interface between ExpressJS handler and Fastify handler, you are at the right place. handlerFn is the place where we can prepare the handler to match with what is needed to operate in desired framework environment, says ExpressJS

  4. The adaptorFn is where we can start the framework specific routine. For example, we'll need to start ExpressJS to listen on certain port to start handling request. With given information of config and handlerFn result, we can register handler to ExpressJS and to start handling accordingly. As this is the place where we will finally make the response to requests, we'll need to also handle unexpected exception

Example

See more examples at how the submodule integrates with few other frameworks under examples

submodule's People

Contributors

lagz0ne avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.