<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Adonis Pavlis</title>
    <description>The latest articles on DEV Community by Adonis Pavlis (@adonispavlis).</description>
    <link>https://dev.to/adonispavlis</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1008369%2F0cb57aca-a4fd-4b99-bca3-ebae8eaca8d2.jpg</url>
      <title>DEV Community: Adonis Pavlis</title>
      <link>https://dev.to/adonispavlis</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adonispavlis"/>
    <language>en</language>
    <item>
      <title>React-use (React Hooks)</title>
      <dc:creator>Adonis Pavlis</dc:creator>
      <pubDate>Sun, 15 Jan 2023 19:15:16 +0000</pubDate>
      <link>https://dev.to/adonispavlis/react-use-11kg</link>
      <guid>https://dev.to/adonispavlis/react-use-11kg</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/streamich/react-use" rel="noopener noreferrer"&gt;React-use&lt;/a&gt; is the package that provides many useful react hooks that we can use to build the UI more efficiently. It provides the hooks related sensors, ui, animations, side-effects, lifecycles, state and etc.&lt;/p&gt;

&lt;p&gt;Sensors&lt;/p&gt;

&lt;p&gt;useBattery — tracks device battery state. &lt;br&gt;
useGeolocation — tracks geo location state of user’s device. &lt;br&gt;
useHover and useHoverDirty — tracks mouse hover state of some element. &lt;br&gt;
useHash — tracks location hash value. &lt;br&gt;
useIdle — tracks whether user is being inactive.&lt;br&gt;
useIntersection — tracks an HTML element’s intersection. &lt;br&gt;
useKey, useKeyPress, useKeyboardJs, and useKeyPressEvent — track keys. &lt;br&gt;
useLocation and useSearchParam — tracks page navigation bar location state.&lt;br&gt;
useLongPress — tracks long press gesture of some element.&lt;br&gt;
useMedia — tracks state of a CSS media query. &lt;br&gt;
useMediaDevices — tracks state of connected hardware devices.&lt;br&gt;
useMotion — tracks state of device’s motion sensor.&lt;br&gt;
useMouse and useMouseHovered — tracks state of mouse position. &lt;br&gt;
useMouseWheel — tracks deltaY of scrolled mouse wheel. &lt;br&gt;
useNetworkState — tracks the state of browser’s network connection. &lt;br&gt;
useOrientation — tracks state of device’s screen orientation.&lt;br&gt;
usePageLeave — triggers when mouse leaves page boundaries.&lt;br&gt;
useScratch — tracks mouse click-and-scrub state.&lt;br&gt;
useScroll — tracks an HTML element’s scroll position. &lt;br&gt;
useScrolling — tracks whether HTML element is scrolling.&lt;br&gt;
useStartTyping — detects when user starts typing.&lt;br&gt;
useWindowScroll — tracks Window scroll position. &lt;br&gt;
useWindowSize — tracks Window dimensions. &lt;br&gt;
useMeasure and useSize — tracks an HTML element’s dimensions. &lt;br&gt;
createBreakpoint — tracks innerWidth&lt;br&gt;
useScrollbarWidth — detects browser’s native scrollbars width. &lt;br&gt;
UI&lt;/p&gt;

&lt;p&gt;useAudio — plays audio and exposes its controls. &lt;br&gt;
useClickAway — triggers callback when user clicks outside target area.&lt;br&gt;
useCss — dynamically adjusts CSS.&lt;br&gt;
useDrop and useDropArea — tracks file, link and copy-paste drops.&lt;br&gt;
useFullscreen — display an element or video full-screen. &lt;br&gt;
useSlider — provides slide behavior over any HTML element. &lt;br&gt;
useSpeech — synthesizes speech from a text string. &lt;br&gt;
useVibrate — provide physical feedback using the Vibration API. &lt;br&gt;
useVideo — plays video, tracks its state, and exposes playback controls. &lt;br&gt;
Animations&lt;/p&gt;

&lt;p&gt;useRaf — re-renders component on each requestAnimationFrame.&lt;br&gt;
useInterval and useHarmonicIntervalFn — re-renders component on a set interval using setInterval.&lt;br&gt;
useSpring — interpolates number over time according to spring dynamics.&lt;br&gt;
useTimeout — re-renders component after a timeout.&lt;br&gt;
useTimeoutFn — calls given function after a timeout. &lt;br&gt;
useTween — re-renders component, while tweening a number from 0 to 1. &lt;br&gt;
useUpdate — returns a callback, which re-renders component when called.&lt;br&gt;
Side-effects&lt;/p&gt;

&lt;p&gt;useAsync, useAsyncFn, and useAsyncRetry — resolves an async function.&lt;br&gt;
useBeforeUnload — shows browser alert when user try to reload or close the page.&lt;br&gt;
useCookie — provides way to read, update and delete a cookie. &lt;br&gt;
useCopyToClipboard — copies text to clipboard.&lt;br&gt;
useDebounce — debounces a function. &lt;br&gt;
useError — error dispatcher. &lt;br&gt;
useFavicon — sets favicon of the page.&lt;br&gt;
useLocalStorage — manages a value in localStorage.&lt;br&gt;
useLockBodyScroll — lock scrolling of the body element.&lt;br&gt;
useRafLoop — calls given function inside the RAF loop.&lt;br&gt;
useSessionStorage — manages a value in sessionStorage.&lt;br&gt;
useThrottle and useThrottleFn — throttles a function. &lt;br&gt;
useTitle — sets title of the page.&lt;br&gt;
usePermission — query permission status for browser APIs.&lt;br&gt;
Lifecycles&lt;/p&gt;

&lt;p&gt;useEffectOnce — a modified useEffect hook that only runs once.&lt;br&gt;
useEvent — subscribe to events.&lt;br&gt;
useLifecycles — calls mount and unmount callbacks.&lt;br&gt;
useMountedState and useUnmountPromise — track if component is mounted.&lt;br&gt;
usePromise — resolves promise only while component is mounted.&lt;br&gt;
useLogger — logs in console as component goes through life-cycles.&lt;br&gt;
useMount — calls mount callbacks.&lt;br&gt;
useUnmount — calls unmount callbacks.&lt;br&gt;
useUpdateEffect — run an effect only on updates.&lt;br&gt;
useIsomorphicLayoutEffect — useLayoutEffect that does not show warning when server-side rendering.&lt;br&gt;
useDeepCompareEffect, useShallowCompareEffect, and useCustomCompareEffect — run an effect depending on deep comparison of its dependencies&lt;br&gt;
State&lt;/p&gt;

&lt;p&gt;createMemo — factory of memoized hooks.&lt;br&gt;
createReducer — factory of reducer hooks with custom middleware.&lt;br&gt;
createReducerContext and createStateContext — factory of hooks for a sharing state between components.&lt;br&gt;
useDefault — returns the default value when state is null or undefined.&lt;br&gt;
useGetSet — returns state getter get() instead of raw state.&lt;br&gt;
useGetSetState — as if useGetSet and useSetState had a baby.&lt;br&gt;
useLatest — returns the latest state or props&lt;br&gt;
usePrevious — returns the previous state or props. &lt;br&gt;
usePreviousDistinct — like usePrevious but with a predicate to determine if previous should update.&lt;br&gt;
useObservable — tracks latest value of an Observable.&lt;br&gt;
useRafState — creates setState method which only updates after requestAnimationFrame. &lt;br&gt;
useSetState — creates setState method which works like this.setState. &lt;br&gt;
useStateList — circularly iterates over an array. &lt;br&gt;
useToggle and useBoolean — tracks state of a boolean. &lt;br&gt;
useCounter and useNumber — tracks state of a number. &lt;br&gt;
useList and useUpsert — tracks state of an array. &lt;br&gt;
useMap — tracks state of an object. &lt;br&gt;
useSet — tracks state of a Set. &lt;br&gt;
useQueue — implements simple queue.&lt;br&gt;
useStateValidator — tracks state of an object. &lt;br&gt;
useStateWithHistory — stores previous state values and provides handles to travel through them. &lt;br&gt;
useMultiStateValidator — alike the useStateValidator, but tracks multiple states at a time. &lt;br&gt;
useMediatedState — like the regular useState but with mediation by custom function. &lt;br&gt;
useFirstMountState — check if current render is first. &lt;br&gt;
useRendersCount — count component renders. &lt;br&gt;
createGlobalState — cross component shared state.&lt;br&gt;
useMethods — neat alternative to useReducer. &lt;br&gt;
Miscellaneous&lt;/p&gt;

&lt;p&gt;useEnsuredForwardedRef and ensuredForwardRef — use a React.forwardedRef safely. &lt;/p&gt;

</description>
      <category>productivity</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Superplate - FRONTEND BOILERPLATE</title>
      <dc:creator>Adonis Pavlis</dc:creator>
      <pubDate>Sun, 15 Jan 2023 19:13:50 +0000</pubDate>
      <link>https://dev.to/adonispavlis/superplate-the-frontend-boilerplate-with-superpowers-3hog</link>
      <guid>https://dev.to/adonispavlis/superplate-the-frontend-boilerplate-with-superpowers-3hog</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjy2ssa55xled6rhf5a66.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjy2ssa55xled6rhf5a66.png" alt="Image description" width="492" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A well-structured production-ready frontend boilerplate with Typescript, Jest, testing-library, styled-component, Sass, Css, .env, Fetch, Axios, Reverse Proxy, Bundle Analyzer and 30+ plugin. For now, only creates projects for React and Next.js.&lt;/p&gt;

&lt;p&gt;You can add useful, highly-demands front-end development tools and libraries as a plugin by using superplate CLI during the project creation phase.&lt;/p&gt;

&lt;p&gt;To learn on how superplate and its plugins work, you can check out our &lt;a href="https://pankod.github.io/superplate/" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>learning</category>
      <category>career</category>
      <category>productivity</category>
      <category>discuss</category>
    </item>
    <item>
      <title>React Context</title>
      <dc:creator>Adonis Pavlis</dc:creator>
      <pubDate>Sat, 14 Jan 2023 22:42:02 +0000</pubDate>
      <link>https://dev.to/adonispavlis/react-context-52e9</link>
      <guid>https://dev.to/adonispavlis/react-context-52e9</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xTrjALIU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/89nb09xjqkyi9ch362aa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xTrjALIU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/89nb09xjqkyi9ch362aa.png" alt="Image description" width="300" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conception&lt;/strong&gt;&lt;br&gt;
React Context API is a way to essentially create global variables that can be passed around in a React app. This is the alternative to “prop drilling”, or passing props from grandparent to parent to child, and so on. Context is often touted as a simpler, lighter solution to using Redux for state management&lt;br&gt;
Context provides a way to pass data through the component tree without having to pass props down manually at every level.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantage&lt;/strong&gt;&lt;br&gt;
– Context API doesn’t require any third-party libraries.&lt;br&gt;
– Optimization on project’s overall structure and speed side.&lt;br&gt;
– Stable management for state:&lt;br&gt;
( To a good extent, Redux works for state management in React applications and has a few advantages, but its verbosity makes it really difficult to pick up, and the ton of extra code needed to get it working in our application introduces a lot of unnecessary complexity.&lt;br&gt;
On the other hand, with the useContext API and React Hooks, there is no need to install external libraries or add a bunch of files and folders in order to get our app working. This makes it a much simpler, more straightforward way to handle global state management in React applications. )&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Application&lt;/strong&gt;&lt;br&gt;
In many case, we use Redux as choice for state management, But sometimes, Redux may be non-suitable for developer’s needs.&lt;br&gt;
I used context and consumer in main components of React project, and after defining context, it will provide all state and actions needed.&lt;br&gt;
The result is very similar with Redux.&lt;br&gt;
Mostly, React context has used as combination type with React hooks, here is reference link:&lt;br&gt;
&lt;a href="https://www.hoseinh.com/react-context-vs-redux-hooks/"&gt;https://www.hoseinh.com/react-context-vs-redux-hooks/&lt;/a&gt;&lt;br&gt;
Regarding comparing between Redux and React context + Hooks, Context can’t still kill Redux, but I think it might be more useful in proper case.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reference&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://reactjs.org/docs/context.html"&gt;https://reactjs.org/docs/context.html&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.taniarascia.com/using-context-api-in-react/"&gt;https://www.taniarascia.com/using-context-api-in-react/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://blog.logrocket.com/use-hooks-and-context-not-react-and-redux/"&gt;https://blog.logrocket.com/use-hooks-and-context-not-react-and-redux/&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>WebRTC Implementation with React and React Native by using OpenTok</title>
      <dc:creator>Adonis Pavlis</dc:creator>
      <pubDate>Sat, 14 Jan 2023 22:40:05 +0000</pubDate>
      <link>https://dev.to/adonispavlis/webrtc-implementation-with-react-and-react-native-by-using-opentok-23m7</link>
      <guid>https://dev.to/adonispavlis/webrtc-implementation-with-react-and-react-native-by-using-opentok-23m7</guid>
      <description>&lt;p&gt;Add &lt;strong&gt;opentok-react&lt;/strong&gt; as a dependency of your application:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;yarn add opentok-react&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Or if you’re still using npm:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install --save opentok-react&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then include &lt;strong&gt;opentok.js&lt;/strong&gt; before your application:&lt;br&gt;
&lt;code&gt;&amp;lt;script src="https://static.opentok.com/v2/js/opentok.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Alternatively, wrap your top-level component using OpenTok with the &lt;a href="https://www.npmjs.com/package/opentok-react#preloadscript-higher-order-component"&gt;preloadScript&lt;/a&gt; HOC. The HOC will take care of loading opentok.js for you before rendering.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/opentok/opentok-react"&gt;https://github.com/opentok/opentok-react&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/opentok/opentok-react-native-samples"&gt;https://github.com/opentok/opentok-react-native-samples&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Angular DevTools</title>
      <dc:creator>Adonis Pavlis</dc:creator>
      <pubDate>Sat, 14 Jan 2023 22:31:17 +0000</pubDate>
      <link>https://dev.to/adonispavlis/angular-devtools-1dm3</link>
      <guid>https://dev.to/adonispavlis/angular-devtools-1dm3</guid>
      <description>&lt;p&gt;Angular DevTools is a Chrome extension that provides debugging and profiling capabilities for Angular applications. Angular DevTools supports Angular v9 and later, with Ivy enabled.&lt;/p&gt;

&lt;p&gt;You can find Angular DevTools in the &lt;a href="https://chrome.google.com/webstore/detail/angular-developer-tools/ienfalfjdbdpebioblfackkekamfmbnh"&gt;Chrome Web Store&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After installing Angular DevTools, find the extension under the Angular tab in Chrome DevTools.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KoOOnulV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pmhwq0co08xte88diy3c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KoOOnulV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pmhwq0co08xte88diy3c.png" alt="Image description" width="880" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you open the extension, you’ll see two additional tabs:&lt;/p&gt;

&lt;p&gt;Components – lets you explore the components and directives in your application and preview or edit their state.&lt;br&gt;
Profiler – lets you profile your application and understand what the performance bottleneck is during change detection execution.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lbp_HOPD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ssf8z3cl07m8ttdw4u2d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lbp_HOPD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ssf8z3cl07m8ttdw4u2d.png" alt="Image description" width="880" height="156"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the top-right corner of Angular DevTools you’ll find which version of Angular is running on the page as well as the latest commit hash for the extension.&lt;/p&gt;

&lt;p&gt;You can find more details at &lt;a href="https://angular.io/guide/devtools"&gt;here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>angular</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
