-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 4.05 KB
/
.eslintcache
1
[{"/home/ts/Desktop/reactNodejs/firebasereacttodo/src/reportWebVitals.js":"1","/home/ts/Desktop/reactNodejs/firebasereacttodo/src/App.js":"2","/home/ts/Desktop/reactNodejs/firebasereacttodo/src/Todo.js":"3","/home/ts/Desktop/reactNodejs/firebasereacttodo/src/firebase.js":"4","/home/ts/Desktop/reactNodejs/firebasereacttodo/src/index.js":"5"},{"size":362,"mtime":1607666654523,"results":"6","hashOfConfig":"7"},{"size":1869,"mtime":1607687267620,"results":"8","hashOfConfig":"7"},{"size":2694,"mtime":1607688027490,"results":"9","hashOfConfig":"7"},{"size":453,"mtime":1607677156360,"results":"10","hashOfConfig":"7"},{"size":500,"mtime":1607666654523,"results":"11","hashOfConfig":"7"},{"filePath":"12","messages":"13","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"14"},"1ym5g2i",{"filePath":"15","messages":"16","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"17"},{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"20","messages":"21","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"22"},{"filePath":"23","messages":"24","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"22"},"/home/ts/Desktop/reactNodejs/firebasereacttodo/src/reportWebVitals.js",[],["25","26"],"/home/ts/Desktop/reactNodejs/firebasereacttodo/src/App.js",["27"],"import { Button, FormControl, Input, InputLabel } from \"@material-ui/core\";\nimport React, { useState, useEffect } from \"react\";\nimport \"./App.css\";\nimport Todo from \"./Todo\";\nimport db from \"./firebase\";\nimport firebase from \"firebase\";\nimport Snackbar from '@material-ui/core/Snackbar';\n\nfunction App() {\n const [todos, setTodos] = useState([]);\n const [input, setInput] = useState(\"\");\n \n\n //when the app loads, we need to listen to the database and fetch new todos as they get added/remove\n\n useEffect(() => {\n //this code here .. fires when the app.js loads\n db.collection(\"todos\")\n .orderBy(\"timestamp\", \"desc\")\n .onSnapshot((snapshot) => {\n console.log(snapshot.docs.map((doc) => doc.data().todo));\n setTodos(\n snapshot.docs.map((doc) => ({ id: doc.id, todo: doc.data().todo }))\n );\n });\n }, []);\n\n const addTodo = (event) => {\n //this will fire off when we click the button\n event.preventDefault(); //will stop refresh\n\n db.collection(\"todos\").add({\n todo: input,\n timestamp: firebase.firestore.FieldValue.serverTimestamp(),\n });\n\n setInput(\"\"); //clear up the input after hitting submit\n };\n\n return (\n <div className=\"App\">\n <h2>Todo App Crud With Reactjs & Firebase</h2>\n <br />\n <form>\n <FormControl>\n <InputLabel>✅ Write a Todo..</InputLabel>\n <Input\n value={input}\n onChange={(event) => setInput(event.target.value)}\n />\n </FormControl>\n\n <Button\n type=\"submit\"\n onClick={addTodo}\n variant=\"contained\"\n color=\"primary\"\n disabled={!input}\n >\n Add Todo\n </Button>\n </form>\n\n <ul>\n {todos.map((todo) => (\n <Todo todo={todo} />\n ))}\n </ul>\n </div>\n );\n}\n\nexport default App;\n","/home/ts/Desktop/reactNodejs/firebasereacttodo/src/Todo.js",[],"/home/ts/Desktop/reactNodejs/firebasereacttodo/src/firebase.js",[],["28","29"],"/home/ts/Desktop/reactNodejs/firebasereacttodo/src/index.js",[],{"ruleId":"30","replacedBy":"31"},{"ruleId":"32","replacedBy":"33"},{"ruleId":"34","severity":1,"message":"35","line":7,"column":8,"nodeType":"36","messageId":"37","endLine":7,"endColumn":16},{"ruleId":"30","replacedBy":"38"},{"ruleId":"32","replacedBy":"39"},"no-native-reassign",["40"],"no-negated-in-lhs",["41"],"no-unused-vars","'Snackbar' is defined but never used.","Identifier","unusedVar",["40"],["41"],"no-global-assign","no-unsafe-negation"]