JSFiddle - React, Tailwind, and code Playground
by Robodude
JavaScript
class QueryStringThing {
constructor(event){
this.queryString = event.whatever.queryString
}
getParam(id){
if (this.queryString[id] == null) {
throw new Error()
}
return this.queryString[id]
}
}
class Whatever {
constructor(event){
this.queryStringThing = new QueryStringThing(event)
}
doSomething(){
const name = this.queryStringThing.get("Name")
console.log(name)
}
}