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 { useState, useEffect, useCallback } from "react"; | |
| export const useFetch = ({ url, init, processData }) => { | |
| // Response state | |
| const [data, setData] = useState(); | |
| // Turn objects into strings for useCallback & useEffect dependencies | |
| const [stringifiedUrl, stringifiedInit] = [JSON.stringify(url), JSON.stringify(init)]; | |
| // If no processing function is passed just cast the object to type T |
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
| { | |
| // Editor & Debuger | |
| "editor.suggestSelection": "first", | |
| "editor.minimap.renderCharacters": false, // Use text representation in minimap on the right side | |
| "editor.minimap.showSlider": "always", // Highlight visible code area in minimap on right side | |
| "editor.copyWithSyntaxHighlighting": true, // CTRL + C will also copy the code highlighting | |
| "editor.cursorBlinking": "solid", // Change cursor blinking style | |
| "editor.multiCursorModifier": "ctrlCmd", // Use CTRL + Mouse click to place multiple cursors and write simulatnously | |
| "editor.guides.bracketPairs": true, // Colorize vertical line indicating bracket range on the left hand side | |
| "editor.bracketPairColorization.enabled": true, // Colorize pairs of brackets |
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
| [tool. Ruff] | |
| line-length = 88 | |
| target-version = "py310" | |
| # See https://beta.ruff.rs/docs/rules/ | |
| select = [ | |
| "F", # Pyflakes | |
| "E", # pycodestyle (Errors) | |
| "W", # pycodestyle (Warnings) | |
| "I", # isort |
OlderNewer