Giter Site home page Giter Site logo

gitter-badger / redux-devtools-extension Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zalmoxisus/redux-devtools-extension

0.0 0.0 0.0 9.29 MB

Home Page: https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd

License: MIT License

JavaScript 95.46% HTML 4.54%

redux-devtools-extension's Introduction

Redux DevTools Extension

Build Status Build status Windows

Demo

Usage

1. Get the extension

1.1 For Chrome
1.2 For Firefox
1.3 For Electron
1.4 For other browsers and non-browser environment

2. Use with Redux

2.1 Basic store

If you have a basic store as described in the official redux-docs, simply replace:

let store = createStore(reducer);

with

let store = createStore(reducer, window.devToolsExtension && window.devToolsExtension());
2.2 Advanced store setup
import { createStore, applyMiddleware, compose } from 'redux';

let store = createStore(reducer, initialState, compose(
  applyMiddleware(...middleware)
));

to this:

let store = createStore(reducer, initialState, compose(
  applyMiddleware(...middleware),
  window.devToolsExtension ? window.devToolsExtension() : f => f
));
  • Or with initialState but without middleware and enhancers arguments:
let store = createStore(reducer, initialState, 
  window.devToolsExtension && window.devToolsExtension()
);

Note: passing enhancer as last argument requires redux@>=3.1.0. For older versions apply it like here or here.

2.3 Together with Redux DevTools

You can use this extension together with vanilla Redux DevTools as a fallback, but not both simultaneously:

window.devToolsExtension ? window.devToolsExtension() : DevTools.instrument()

Make sure not to render DevTools when using the extension or you'll probably want to render the monitor from vanilla DevTools as follows:

{ !window.devToolsExtension ? <DevTools /> : null }

3. Use with universal (isomorphic) apps

  typeof window === 'object' && typeof window.devToolsExtension !== 'undefined' ? window.devToolsExtension() : f => f

4. For React Native, hybrid, desktop and server side Redux apps

Include Remote Redux DevTools, and from the extension's context menu choose 'Open Remote DevTools' or press Alt+Shift+arrow up for remote monitoring.

Documentation

##๐Ÿ“บ Videos

Demo

Open these urls to test the extension:

Also you may run them from ./examples folder (on port 4001 and 4002 by default).

Credits

LICENSE

MIT

Created By

If you like this, follow @mdiordiev on twitter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.