Hey all! Iām taking a break from writing my Finance App blog posts to write some fundamental blog posts. These will serve as references that I can point to from my Finance App posts, and any other future tutorials. Thanks to my good friend, Devonta for giving me a much better strategy when writing blog posts.
In trying to learn as much about the C# environment as I can, I decided to write about something almost everyone in the community is aware of.
React has gone through a Component API change before Before Class Components were introduced, there was a (now deprecated) createClass method that was the standard. Here is an example of what a call to this method looks like:
const MyComponent = React.createClass({ render() { return <h1>Francisco's First React Component!</h1> }, }) Then, ES6 came and delivered many features. One of which was the introduction of Classes. The ability to have an OO styled project in Javascriptās prototypal inheritance world was big.
If you remember my last post, I was having trouble with Promises. I didnāt know it at the time, but I was struggling with structuring my code to fully leverage the chaining power of Promises.
So with my new findings Iāll explain the same GET request, now fully powered by promises!
Environment We are running a pretty bare bones Express.js server, with bodyParser We also swapped out mysql with promise-mysql for better compatability with Typescript.
Promises have their own kind of hell. And itās almost as crazy as callback hell. Writing DAO and Manager layers in Node.js with promises has been some adventure. Iām going to talk through a simple get request for some photos with tags and demonstrate my process and pain points. Hopefully any reader (or myself) in the future can smack me in the face and say
You dope! Just do [fill in better solution here]
Oh, hey. Iām doing this again. So, as you may notice, my blog got a revamp. I think my previous design was more of a POC and fun experiment than for practicality. So, I moved to hugo. They let me blog in Markdown which is awesome :sunglasses:
Wait, but we donāt care. I do. So fuck off.
Wow, kinda passive agressive donāt you think? ā¦
What does this mean? Im gonna try to post more than ever.