How I test redux-saga – codeburst

  • How I test redux-sagaI’m a fan of redux saga (although I’ve been keeping an eye on redux-observable too).
  • I particularly like having all async logic in one place, making it easily testable and having powerful async control flows available where necessary.Because the saga effects only construct a special object that is consumed and executed by the middleware (aka they dont do much!)
  • , it is really easy to test your sagas with no mocking required.Few points of note:The mock result of the api (true or false) is injected into the subsequent next() call after the api call.
  • clone()” to test different control flow branches

I particularly like having all async logic in one place, making it easily testable and having powerful async control flows available where necessary. Because the saga effects only construct a special…
Continue reading “How I test redux-saga – codeburst”

Parashuram’s blog: Debugging create-react-native-app with VSCode

  • VIDEO

    To get started download VSCode and install the React Native tools extension for VSCode.

  • Time travel debugging
    The extension uses Node to debug the Expo app.
  • If we replace Node with node-chakracore, we also get the ability to use time travel debugging.
  • To try out time travel debugging with create-react-native-app and VSCode

    Download node-chakra nightly builds – it supports Mac, Windows and Linux 🙂
    Grab the debugger code and save it as debugger.js – this is the same code that runs when a React Native app is debugged on Chrome
    To start recording a trace

    Create a folder called logs, adjacent to debugger.js
    Run path-to-node-chakra/bin/node –record debugger.js

    To replay a debugging session 

    Start up VSCode, head to the debug pane and create a new configuration to debug a node project
    Add the additional key value pairs to the configuration (as shown in the video).

  • This basically sets the node executable to be ChakraCore, points it to the location of the logs that are used for time travel, and sets up source maps
    Hit the debug button – you will now see “Reverse Continue” and “Step back” in addition to the usual debug workflow controls

    The time travel debugging part is still experimental, but if it sounds fun, let me know, and I would love to make it a part of the extension.Thanks to the amazing folks on the Chakra team for making this possible !

Continue reading “Parashuram’s blog: Debugging create-react-native-app with VSCode”

React.js controlled components

#ReactJS controlled components:

  • Since the value attribute is set on our form element, the displayed value will always be this.state.value , making the React state the source of truth.
  • In HTML, form elements such as ,
  • An input form element whose value is controlled by React in this way is called a “controlled component”.
  • In React, mutable state is typically kept in the state property of components, and only updated with setState() .
  • Component { constructor(props) { super(props); this.state = { value: ‘Please write an essay about your favorite DOM element.’

React.js controlled components. HTML Forms. Input. Textarea. Select.
Continue reading “React.js controlled components”

Next.Js – JavaScript Mantra – Medium

Next.Js: Is it the next big thing in JavaScript? @arunoda  #JavaScript #Reactjs

  • Just create a few files for pages in your app, and you are done.
  • For example, let’s say you need to create web app with two pages (Home page and About page).
  • It uses the file system as the router for your app.
  • You need to bring additional stuff which is needed for your app.
  • import React from ‘react’ import Header from ‘.

There are too many JS frameworks out there — we all know that.
But still, we see new JS frameworks every day. Next.js may not cure JS Fatigue, but it allows us to build web apps in JavaScript as we…
Continue reading “Next.Js – JavaScript Mantra – Medium”

Apollo Server 0.2: GraphQL with Express, Connect, HAPI or Koa — Building Apollo — Medium

Apollo Server 0.2: GraphQL with Express, Connect, HAPI or Koa  #ReactJS

  • We removed support for defining GraphQL schemas in schema language and moved it to an entirely separate npm module – graphql-tools .
  • We also wanted to make the project more maintainable by using TypeScript.
  • Express-graphql could adopt those features of Apollo Server which have proven themselves in practice.
  • Query Batching is a feature we recently introduced in Apollo Client, but it involved merging multiple queries into a single one, which made the queries sent to the server hard to read.
  • Apollo Server is a GraphQL server for JavaScript, built by an open-source community of GraphQL enthusiasts.

Read the full article, click here.


@ReactiveConf: “Apollo Server 0.2: GraphQL with Express, Connect, HAPI or Koa #ReactJS”


A simple and modular GraphQL server for Node.js


Apollo Server 0.2: GraphQL with Express, Connect, HAPI or Koa — Building Apollo — Medium