Last active
November 2, 2019 00:03
-
-
Save asktami/9f4af25f5598b19d2e9a109ec6c80ff7 to your computer and use it in GitHub Desktop.
Learning A New Codebase Questions
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
| API | |
| - "What are the async and await statements in articles-route.js?" | |
| ANSWER: An async function can contain an await expression that pauses the execution of the async function and waits for the passed Promise 's resolution, and then resumes the async function's execution and evaluates as the resolved value. | |
| - What are "json_strip_nulls" and "json_build_object" in PostgreSQL? in articles-service.js" | |
| ANSWER: Returns from_json with all object fields that have null values omitted. Other null values are untouched. | |
| CLIENT | |
| - what's in the services / contexts / routes directory? | |
| SERVICES = holds functions to do different fetch requests against API endpoints | |
| CONTEXTS = to have Providers instead of prop drilling; to pass share functions and state with multiple components from one source | |
| ROUTES = load different components/send different request to API endpoints based on changes to the URL / url parameters | |
| - What's going on in ArticleContext.js? | |
| ANSWER: is a Provider, used to pass functions and state to _everything_ because it is used in Index.js | |
| and wraps around the App component. | |
| - What's the TOKEN_KEY config setting for in ./src/config.js? | |
| ANSWER: blogful-client-auth-token | |
| ****** My Question: why isn't it REACT_APP_TOKEN_KEY? | |
| ABOUT THINGFUL SERVER AND CLIENT: | |
| - How are the syntaxes async and await useful when writing JavaScript code? | |
| ANSWER: to pause and wait for a function to execute? | |
| - With respect to Knex, how does the transaction method relate to BEGIN and COMMIT syntax in PostgreSQL? | |
| ANSWER: transaction rolls back if a problem occures in any part??? | |
| - What is a "sequence table" in PostgreSQL? | |
| ANSWER: A sequence is a special kind of database object designed for generating unique numeric identifiers. It is typically used to generate artificial primary keys. | |
| - What does RESTART IDENTITY CASCADE do? | |
| ANSWER: resets the sequences associated with the table columns (resets the serial numbers, primary id field) | |
| - What does SELECT setval('blogful_users_id_seq', 1) do? | |
| ANSWER: sets the next value for the "id" field | |
| - read up on https://www.npmjs.com/ - Treeize: | |
| https://www.npmjs.com/package/treeize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment