Comments (4)
I don't think that is possible, decorators are needed to use getSandhandsSchema
with a string. See decorators.ts
from neistion.
Or you could just do
new NeistonParameters('RandomParameters', {...config})
This would be more consistent with the way it's implemented with a string in the API as well
Edit: you can do the other way still let me post an example
from neistion.
class A extends InputParameters {
constructor(props) {
super(props)
}
}
class InputParameters {
constructor(props) {
console.log(this.__proto__.constructor.name)
}
}
new A({b: 12}) // logs 'A'
Edit: wait that's only when instantiated... nvm, I do think the second suggestion would be good because as it stands overriding each prop is strenuous on the developer and isn't readable well
from neistion.
Actually, a generator pattern like this would be useful; we might make a generator function and make it return symbol so there will be no string hardtyping. However, the whole purpose of this system to have parameters IntelliSense; which probably won't work in this case.
from neistion.
Related Issues (18)
- Per Route Middleware HOT 2
- TypeScript Options Post-Install Hook HOT 1
- HTTP Method String Support? HOT 4
- Move setup to the Neistion constructor? HOT 1
- parametersSchema Accept Strings? HOT 1
- Options for getting the parameters HOT 2
- Support Fastify HOT 1
- Verify Function Return String and/or status code HOT 1
- Verify Function Accept Callback HOT 4
- transformParameters & normalizeParameters HOT 1
- routeFolder HOT 2
- Implement Directory Routes for routeFolder HOT 1
- Add reference/documentation
- Add support for Express style routing HOT 3
- Add tests
- Allow not supplying an app instance
- Create Formal Docs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neistion.