This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const materialTypeReducer = (acc: { [materialType: string]: number }, current: Silo) => { | |
const material = current.material.replace(" ", ""); | |
if (Object.keys(acc).indexOf(material) === -1) { | |
acc[material] = current.weight; | |
} | |
else { | |
acc[material] += current.weight; | |
} return acc; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "./config/database"; | |
import UserRoutes from "./api/AuthRoutes"; | |
import { server } from "./config/GlobalSettings"; | |
server.use(UserRoutes); | |
const port: number = 5000; | |
server.listen(port, () => | |
console.log(` \n Server started on port ${port} \n `) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File 1 | |
import getCompanyName from "./Functions"; | |
const Config = () => { | |
let getname = getCompanyName() ? getCompanyName() : "Gssons EL AB"; | |
}; | |
export default Config; | |
// File 2 | |
import getname from "./Includes/Config"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from "react"; | |
const App = () => { | |
const [form, setForm] = useState({ uname: "", cars: "", sex: "" }); | |
const typer = (e) => { | |
setForm({ ...form, [e.target.name]: e.target.value }); | |
}; | |
const Show = () => { | |
console.log(form); | |
}; | |
return ( |