react-compound-slider — React compound slider | Next level slider component 🎰 #ReactJS

react-compound-slider — React compound slider | Next level slider component 🎰   #ReactJS

  • To install and save in your dependencies, run: – – This library takes a compound component approach to creating sliders that separates the data/logic from presentation.
  • The components use the function as child components pattern.
  • By taking this approach it also frees you up to render whatever markup you want to customize your slider.
  • In general slider components are composed of a relatively positioned outer div with elements absolutely positioned inside by a percentage.
  • In this library the , , and components are used as children to the component and they let you tap into a stream of values and percentages that you can then use to render your own components.

react-compound-slider – React Compound Slider | Next Level Slider Component :slot_machine:
Continue reading “react-compound-slider — React compound slider | Next level slider component 🎰 #ReactJS”

Deep dive into observed Components with React.js and FrintJS

  • Higher-order componentThe API of the observe higher-order component (HoC) is quite simple:import React from ‘react’;import { observe } from ‘frint-react’;function MyComponent(props) { return div…/div;}const ObservedComponent = default ObservedComponent;It receives a function (that we called fn above), where you can generate your props that will be ultimately passed to your target…
  • Generating props synchronouslyThe fn function also gives you access to the FrintJS App’s instance:const ObservedComponent = observe(function (app) { // this will be the `props` in MyComponent return {}; })(MyComponent);Since you have access to your app instance, you can also get values from it, including providers:const ObservedComponent = observe(function (app)…
  • Because they have this dynamic nature, the observe HoC gives you access to parent props as an Observable:const ObservedComponent = observe(function (app, props$) { // …})(MyComponent);In addition to your FrintJS App instance (app), there is a second argument props$, which is props passed down to you from the parent Component…
  • But as your application grows, there will be times, when you need to work with multiple Observables and return a single props stream.This is where a helper function called streamProps shipped with frint-react can come handy.If you are an RxJS ninja, you may skip this part =DThe streamProps function will…
  • In that case, you may want to pass some default props to your target component before new values are generated.The streamProps helper function receives an optional first argument, where you can pass your default props:import { streamProps } from ‘frint-react’;const defaultProps = { foo: ‘n/a’, bar: ‘n/a’, baz: ‘n/a’,};const props$…

Our focus in this article will be about using the observe higher-order component, shipped from frint-react package. To make the most out of this, it is advised that you read these previous articles…
Continue reading “Deep dive into observed Components with React.js and FrintJS”

A Solution To The React className Controversy – Burke Knows Words

  • People can be so cruel.Another one of these very difficult and sensitive topics is the use of className instead of class in React.Introducing Simple React Snippets: class to classNameNearly everyone has heard of the world famous Simple React Snippets for VS Code.
  • The set of React Snippets that is so good, Ryan Florence once said…And now, Simple React Snippets is even better because it has solved one of the most contentious, difficult and time consuming tasks in React.
  • We don’t go to bed when it gets dark because we have ELECTRICITY, and we don’t have to use Find and Replace to change class to className because Simple React Snippets will now do it for you.How It worksSimple React Snippets uses a very complicated and advanced algorithm to find any…
  • This will bring up the “React: class to ClassName” command.
  • It feels kind of like I’m inviting myself into your house.In any event, I’ll continue to work on that portion and once I’ve ironed out the edge cases, this generation might be the last to know the pains of having to change class to className.What a time to be alive!Grab…

The tech community is no stranger to controversy. Just the other week I was faced with an extremely awkward and difficult situation when someone I thought was a close friend (who I won’t name…
Continue reading “A Solution To The React className Controversy – Burke Knows Words”

Lottie – Render After Effects animations natively on Web, Android and iOS, and React Native

Lottie - Render After Effects animations natively on Web, Android and iOS, and React Native

  • Lottie is a mobile library for Web, and iOS that parses Adobe After Effects animations exported as json with Bodymovin and renders them natively on mobile!
  • Install the zxp manually following the instructions here: Skip directly to “Install third-party extensions” – – Or you can use the script file from here: Or get it directly from the AE plugin clicking on Get Player – – Here’s a video tutorial explaining how to export a basic animation…
  • — with 1 optional parameter name to target a specific animation – – bodymovin.stop() — with 1 optional parameter name to target a specific animation – – bodymovin.setSpeed() — first argument speed (1 is normal speed) — with 1 optional parameter name to target a specific animation – – bodymovin.setDirection()…
  • — with 1 optional parameter name to target a specific animation – – bodymovin.searchAnimations() — looks for elements with class “bodymovin” – – bodymovin.loadAnimation() — Explained above.
  • you can also use addEventListener with the following events: – – Doing this you will have to handle the canvas clearing after each frame – – Another way to load animations is adding specific attributes to a dom element.

lottie-web – Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/
Continue reading “Lottie – Render After Effects animations natively on Web, Android and iOS, and React Native”

Thunks in Redux: The Basics – Fullstack Academy – Medium

Thunks in #Redux : The Basics – Fullstack Academy – Medium  #javascript  #reactjs

  • Thunks in Redux: The BasicsWhat Thunks Are, What They Solve, Other OptionsThis article was born as a gist for React Redux beginners, intended to demystify what thunks are and the motivation for using them.Redux was created by Dan Abramov for a talk.
  • It provides a predictable approach to managing state that benefits from immutability, keeps business logic contained, acts as the single source of truth, and has a very small API.The synchronous and pure flow of data through Redux’s components is well-defined with distinct, simple roles.
  • Notice how a thunk (the function returned from thunkedYell(…)) requires an extra invocation before the work is executed:Here the potential work involves a side effect (logging), but thunks can also wrap calculations that might be slow, or even unending.
  • In any case, other code can subsequently decide whether to actually run the thunk:Aside: LazinessLazy languages like Haskell treat function arguments as thunks automatically, allowing for “infinite” computed-on-demand lists and clever compiler optimizations.
  • Thunks in React  ReduxIn React / Redux, thunks enable us to avoid directly causing side effects in our actions, action creators, or components.

For React & Redux beginners, intended to demystify thunks and the motivation for using them.
Continue reading “Thunks in Redux: The Basics – Fullstack Academy – Medium”

The joy of React+Redux with Elixir/OTP

The joy of React+Redux with Elixir/OTP  #ReactJS #Redux #Elixir

  • Graphically, this is the schema of a Redux app: – – Basically, Redux does the following: – – An OTP GenServer does the following: – – In short, we can use the same mental model for the client and server side.
  • We can dispatch events to Elixir, compute a new version state server side, propagate this state to redux, and our views will get updated automatically.
  • We have just implemented the thick red arrows: – – We will update the store with the state that comes from the server in two different situations.
  • With this, we have connected the server state with Redux state.
  • But, if you want to have state shared between different users, or we want to have pieces of the state in the server for other reasons, such as enforcing validation rules, we can use the same mental mode with Elixir GenServers.

Digital solutions partner. High quality work with Symfony, React and Elixir.
Continue reading “The joy of React+Redux with Elixir/OTP”

5 Best JavaScript Frameworks in 2017

  • In the meanwhile, JavaScript web frameworks can become a silver bullet for quick web app development.
  • Angular.js is often referred to as an MVW (Model-View-Whatever) framework and among the top benefits, for startups and mid-sized companies, people name: quick code production, easy testing of any app part and two-way data binding (changes in the backend are immediately reflected on the UI).
  • As for now, it is reasonably called the most used JS framework for SPAs (Single-Page Applications) development and it boasts the largest community of developers.
  • Back in 2015 Ember was called the best javascript framework for web application, leaving behind React and AngularJS.
  • When it comes to quick web development or prototyping, JavaScript frameworks are among the most favorable and 2017 won’t become an exception.

JavaScript popularity continues its rising. In 2016 we’ve witnessed such great changes, as AngularJS entire upgrade and introduction of Angular 2, ultimate dominating of jQuery that is applied on 96.5% of all JS sites, evolution of ECMAScript, two updates of Node.js in April and October accordingly, React finest hours, and even more.  What to expect from 2017?
Continue reading “5 Best JavaScript Frameworks in 2017”