Profile Picture

Sirwan Afifi

Stories from a web developer.

© 2020. Sirwan Afifi All rights reserved.

WebSocket and React

WebSocket is a communication protocol. It's bidirectional in nature which means that either client or server can send data at any time. With…

Displaying Secured Images

Ran into an interesting problem this week with displaying secured images on the page. The problem is that tag doesn't show the image if the…

MobX with React and TypeScript

MobX is one of the popular state management libraries. One of the great things about MobX is that we can store state in a simple data…

Server-Sent Events and React

Server Sents Events are realtime events sent from the server to the client. It's a way to subscribe to a data stream sent by a server…

Setting Up Tailwind

Setup Create a directory then: Install these dependencies: (It creates an empty tailwind.config.js file in the project root): Create a…

Passing custom HTTP Header via Apollo Client

Today I wanted to send along an array as a parameter with all queries from client to server. But I wanted to find a quick way to accomplish…

Redux

Redux is a predictable state container for JavaScript apps. The whole state of your app is stored in an object tree inside a single store…

Initializing state using class field declaration

If you want to initialize state in a class based component we have two options: In constructor As a class property For class based…

Flux

What's Flux? A design pattern developed at Facebook to keep data flowing in one direction (unidirectional data flow) An alternative to MVC…

Building Ionic React App

Make sure you have Node.js installed (https://nodejs.org/dist/v12.13.0/node-v12.13.0-x86.msi) Open command prompt and type in this command…