SSE, which stands for Server-Sent Events, is a quite nice way of simplex data transfer from server to clients, at server’s will. This avoids repetitive polling by the clients or unnecessary full-duplex web sockets. Typical SSE use cases include, news updates, social media feeds, stock price changes, etc.
In this discussion we will see how we can implement a simple SSE using just NodeJS. I feel like I can express it better without a library.
We will implement a simple News service. Which will eventually run out of news, and we will notify the client about it. …
I have read about fibonacci series, I have read about memoization, and also I have read about how to optimize fibonacci series with memoization. That’s it. I have read about them, but time has come to see if it really works, so original.
What would we do without wikipedia!
Note: In general, the time complexity of generating Nth fibonacci number
is O(2^N), but using memoization it comes down to O(N), of course with the space complexity of O(N), but it’s a sweet deal. …
Everything should be made as simple as possible, but not simpler
— Albert Einstein
I have always wondered how to perform front-end routing in a single page application. Finally I got my answer from the History API. Here I am going to show what I did to achieve a front-end routing.
First of all, design the end-user API that is going to be consumed.
Now, lets define the consumption of changePath in those components.