Code Monkey home page Code Monkey logo

Comments (3)

canmingir avatar canmingir commented on September 28, 2024

Definitely, I am still vetting couple options, but the best way that I can come with extending the class like this

import nucleoid, { Prototype } from "nucleoidjs";
const app = nucleoid();

class User extends Prototype {
  name: string;

  constructor(name: string) {
    super();
    this.name = name;
  }
}

app.post("/users", () => User.filter((u) => u.name === "Daphne"));

from nucleoid.

canmingir avatar canmingir commented on September 28, 2024

The way I understand this is that when I register a class I get static helper methods on the class in runtime but these do not exist in the code itself, nor their type declarations.

That is right, the runtime rerenders JavaScript and creates graph (all of them happens at the runtime tho). It provides some shortcuts like turning class into array in order to query like in database table. Since all of them happening at the runtime, it is quite conflicts with TypeScript, which is compile time.

from nucleoid.

CanPacis avatar CanPacis commented on September 28, 2024

I think an extendible prototype solution would be the cleanest. I would be easy to read and understand, while not clashing with ide's

from nucleoid.

Related Issues (11)

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.