<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Skyrockets on Medium]]></title>
        <description><![CDATA[Stories by Skyrockets on Medium]]></description>
        <link>https://medium.com/@skyrockets?source=rss-369217cd57d6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QprV1xn2tTttbSGQSlP14g.jpeg</url>
            <title>Stories by Skyrockets on Medium</title>
            <link>https://medium.com/@skyrockets?source=rss-369217cd57d6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 17:30:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@skyrockets/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Recoil.js: Efficient state management and better render performance in React Apps.]]></title>
            <link>https://medium.com/@skyrockets/recoil-js-efficient-state-management-and-better-render-performance-in-react-apps-f3aaf7df96ba?source=rss-369217cd57d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3aaf7df96ba</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[recoiljs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Skyrockets]]></dc:creator>
            <pubDate>Fri, 22 May 2020 08:48:42 GMT</pubDate>
            <atom:updated>2020-05-22T08:48:42.374Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ojLSYpeG6BO2PPIFGhCaLQ.jpeg" /></figure><p>In this guide we will learn about <strong>Recoil.js</strong>, a new library for React for efficient state management and better component rendering cycles.</p><p>This guide is an extraction from the official documentation you can check here if you want full information <a href="https://recoiljs.org/">here</a></p><h3><strong>What is Recoil.js</strong></h3><p>Recoil lets you create a data-flow graph that flows from<strong> <em>atoms</em> </strong>(shared state) through <strong><em>selectors</em></strong> (pure functions) and down into your React components. Atoms are units of the state that components can subscribe to. Selectors transform this state either synchronously or asynchronously.</p><h3>Recoil.js composed of<strong> ATOMS and SELECTOR</strong></h3><p><strong>1. Atoms:</strong> Atoms are units of the state. They’re updateable and subscribable: when an atom is updated, each subscribed component is re-rendered with the new value. They can be created at runtime, too. Atoms can be used in place of React local component state. If the same atom is used from multiple components, all those components share their state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*ypuxfgMyr3JNbsbwXkMyOw.png" /></figure><p>Now the above atom (a piece of state) can be used by multiple components just like a normal useState variable and also you can change this global state.</p><p><strong>Using Atoms: </strong>Using the Same Atom in multiple components, changing Atom state gets reflected in all components</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t6-1WT7RDnIzCsf_YKQCkw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yr0LDWXXRhsuLwR06FOLbg.png" /></figure><p><strong>2. Selectors:</strong> A selector is a pure function that accepts atoms or other selectors as input. When these upstream atoms or selectors are updated, the selector function will be re-evaluated. Components can subscribe to selectors just like atoms, and will then be re-rendered when the selectors change.</p><p>Selectors are used to calculate derived data that is based on state. This lets us avoid redundant state, usually obviating the need for reducers to keep state in sync and valid. Instead, a minimal set of state is stored in atoms, while everything else is efficiently computed as a function of that minimal state. Since selectors keep track of what components need them and what state they depend on, they make this functional approach more efficient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YCYL-CEVSvuodwacPLVvlA.png" /></figure><p>The get property is the function that is to be computed. It can access the value of atoms and other selectors using the get argument passed to it. Whenever it accesses another atom or selector, a dependency relationship is created such that updating the other atom or selector will cause this one to be recomputed.</p><p>In this userNameFormatState example, the selector has one dependency: the userNamState atom. Conceptually, the userNameFormatState selector behaves like a pure function that takes a userNameState as input and returns a formatted font size label as output.</p><p>Selectors can be read using useRecoilValue(), which takes an atom or selector as an argument and returns the corresponding value. We don&#39;t use the useRecoilState() as the userNameFormatState selector is not writeable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lwV7D4rSnOUQRtD4xUCCqQ.png" /></figure><h3>Asynchronous Data Queries</h3><p>Recoil provides a way to map state and derived state to React components via a data flow graph. What’s really powerful is that the functions in the graph can also be asynchronous. This makes it easy to use asynchronous functions in synchronous React component render functions. Recoil allows you to seemlessly mix synchronous and asynchronous functions in your data flow graph of selectors. Simply return a Promise to a value instead of the value itself from a selector get callback, the interface remains exactly the same. Because these are just selectors, other selectors can also depend on them to further transform the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KCyYr1Vk3SfM784ecePDaA.png" /></figure><h3>Queries with Parameters</h3><p>Sometimes you want to be able to query based on parameters that aren’t just based on derived state. For example, you may want to query based on the component props. You can do that using the selectorFamily helper:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TxFJZSEQqh1CdJebsNd5mw.png" /></figure><h3>Displaying Loading Indicator While Fetching Data:</h3><p>We can also use the useRecoilValueLoadable() hook to determine the status during rendering:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pevxPx3znFbal_UKodExZQ.png" /></figure><p>Thanks 🙂 .</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3aaf7df96ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Native + webRTC (Video Calling Mobile Application)]]></title>
            <link>https://medium.com/@skyrockets/react-native-webrtc-video-calling-mobile-application-26223bf87f0d?source=rss-369217cd57d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/26223bf87f0d</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[webrtc]]></category>
            <dc:creator><![CDATA[Skyrockets]]></dc:creator>
            <pubDate>Wed, 20 May 2020 08:56:55 GMT</pubDate>
            <atom:updated>2020-09-14T06:02:40.098Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CgkfaPlZe9gUc_Yqqdz6ow.jpeg" /></figure><p>Demo: <a href="https://www.youtube.com/watch?v=7i4sT1B1yz8">https://www.youtube.com/watch?v=7i4sT1B1yz8</a></p><p><strong>Required basic understanding of :</strong></p><ol><li>React / React Native</li><li>React Hooks</li></ol><p><strong>What we will be creating</strong></p><ol><li>Video calling application for Android + IOS</li><li>Implementing webRTC using package “react-native-webrtc”</li><li>Using Websockets for signaling</li><li>Using UI components from ‘react-native-paper”</li></ol><p><strong>Note: In this guide, we will only implement the frontend part, there will be no guide for backend i.e handling socket events and other backend work.</strong></p><p>webRTC is a great tool for establishing real-time communication over web. In this guide we are going to implement webRTC in a React Native mobile application using package react-native-webrtc, basically, this package is an adapter which exposes webRTC classes like RTCPeerConnection ,Media Streams etc.</p><p><strong>Steps :</strong></p><ol><li>Setup a react native project using react-native-cli</li></ol><p>You can follow this official guide — <a href="https://reactnative.dev/docs/environment-setup">https://reactnative.dev/docs/environment-setup</a></p><p>2. After Successfully running your demo application we will install some React Native Libraries for UI and Navigation</p><p>Here is my package.json dependencies you also need to install</p><pre>&quot;dependencies&quot;: {<br>&quot;@react-native-community/async-storage&quot;: &quot;^1.10.0&quot;,<br>&quot;@react-native-community/masked-view&quot;: &quot;^0.1.10&quot;,<br>&quot;@react-navigation/native&quot;: &quot;^5.2.3&quot;,<br>&quot;@react-navigation/stack&quot;: &quot;^5.2.18&quot;,<br>&quot;react&quot;: &quot;16.11.0&quot;,<br>&quot;react-native&quot;: &quot;0.62.2&quot;,<br>&quot;react-native-gesture-handler&quot;: &quot;^1.6.1&quot;,<br>&quot;react-native-incall-manager&quot;: &quot;^3.2.7&quot;,<br>&quot;react-native-paper&quot;: &quot;^3.9.0&quot;,<br>&quot;react-native-reanimated&quot;: &quot;^1.8.0&quot;,<br>&quot;react-native-safe-area-context&quot;: &quot;^0.7.3&quot;,<br>&quot;react-native-screens&quot;: &quot;^2.7.0&quot;,<br>&quot;react-native-vector-icons&quot;: &quot;^6.6.0&quot;,<br>&quot;react-native-webrtc&quot;: &quot;^1.75.3&quot;  <br>}</pre><p>3. Building Navigation :</p><p>For building navigation for our application, we are using react-navigation as you can see in the project dependencies list.</p><p>App.js</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/96963b17078f8cf6230da8b8c4b6ddd2/href">https://medium.com/media/96963b17078f8cf6230da8b8c4b6ddd2/href</a></iframe><p>4. As you can see we are importing Login and Call screens in the App Component, now we will create Login screen :</p><p><strong>LoginScreen.js</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/77a0fb8016f0367f44187141c452e23f/href">https://medium.com/media/77a0fb8016f0367f44187141c452e23f/href</a></iframe><p>Here in the above file we are just storing a unique USER ID which will represent this user, and can be referred by another connected user, here you can assign a unique id for any of you users,</p><p>THE MAIN CODE FOR IMPLEMENTING WEBRTC :</p><p><strong>5.The CallScreen Code:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9e84311d0198c1268fc4ae4ee8f17421/href">https://medium.com/media/9e84311d0198c1268fc4ae4ee8f17421/href</a></iframe><p>In the above file, there is a lot of code , I will explain every line of code :</p><p><strong>The Main Parts :</strong></p><p>setting userID : the user which is currently logged in</p><p>connectedUser : while making a call to another user using his ID this variable is assigned to that users ID</p><p>Video/Audio Streams:</p><p>localStream : Accessing local video stream of a user using his/her mobile camera</p><p>remoteStream: When call is connected the receiver video stream is added to this stream variable</p><blockquote><strong>NOTE : For accessing video stream you need to set some permissions in you android and ios files Permissions are :</strong></blockquote><blockquote><strong>Android — </strong><a href="https://github.com/react-native-webrtc/react-native-webrtc/blob/master/Documentation/AndroidInstallation.md">https://github.com/react-native-webrtc/react-native-webrtc/blob/master/Documentation/AndroidInstallation.md</a></blockquote><blockquote><strong>IOS — </strong><a href="https://github.com/react-native-webrtc/react-native-webrtc/blob/master/Documentation/iOSInstallation.md">https://github.com/react-native-webrtc/react-native-webrtc/blob/master/Documentation/iOSInstallation.md</a></blockquote><p>conn: this establishes your WebSocket connection</p><p>yourConn : this establishes you RTCPeerConnection which will be further used for setting local/remote descriptions and offers</p><p>So Reading all that code in the file you will have<br>1.Streams <br>2.Signaling Socket<br>3.RTCPeerConnection</p><p><strong>SOCKET EVENTS :</strong></p><p>onmessage : fires when we get a message</p><p>Message types and handlers :</p><ol><li>Offer: when one user tries to call another user he creates and offer and send this offer to the other user, then another user will receive the offer, which is handled by handleOffer.</li><li>Candidate: when a sender sends the offer and receiver gets it, it means the senders get a candidate then this handle candidate fires signaling that the call has been ringing or awaiting an answer</li><li>Answer: When a receiver gets an offer he can accept or reject the offer, we can store this offer in variable and later we can create an answer to that offer or can reject/leave <br>If we accept the offer we will add our local stream to the connection so that the sender will get to see our video stream and then we create and answer to that offer and send it.</li><li>Handling Answer: After the receiver sends us an answer, means our call is accepted now we can our and our friend videos on the screens</li><li>Leave: When we call hangUp means we will end the connected call or reject the incoming offer, then we rest all our variables and close the RTCPeerConnection.</li></ol><p>There is concept of like remoteDescription localDescription , you can read this on MDN all about them -<a href="https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/setRemoteDescription">https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/setRemoteDescription</a></p><p>The Process :</p><ol><li>LOGIN : send message to the socket for login</li><li>LOCAL STREAM : get video stream from the local user</li><li>Add Event Listerners for ice candidate update</li><li>Event Listener ontrack triggers when remote user adds his/her stream to this rtcPeerConnection then we will display it.</li></ol><p>Github :<a href="https://github.com/skyrocketscommunity/React-native-webrtcApp">https://github.com/skyrocketscommunity/React-native-webrtcApp</a></p><p>Youtube :<a href="https://www.youtube.com/watch?v=7i4sT1B1yz8">https://www.youtube.com/watch?v=7i4sT1B1yz8</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26223bf87f0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ECMAScript 2015 — Confusion Answered (var,let,cont)]]></title>
            <link>https://medium.com/@skyrockets/ecmascript-2015-confusion-answered-var-let-cont-f079eea358dc?source=rss-369217cd57d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/f079eea358dc</guid>
            <category><![CDATA[js]]></category>
            <category><![CDATA[es2015]]></category>
            <category><![CDATA[ecmascript]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[ecmascript2015]]></category>
            <dc:creator><![CDATA[Skyrockets]]></dc:creator>
            <pubDate>Sat, 26 May 2018 12:45:55 GMT</pubDate>
            <atom:updated>2018-05-26T12:45:55.985Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*wgXYmURt6wJgwnlVCKP_Ig.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f079eea358dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>