npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ng-redux-dev-tools

v0.1.3

Published

DevTools for Redux using Angular 1.x

Downloads

14

Readme

Angular Redux DevTools

build status npm version

The goal of this version of the Redux DevTools is to provide a React free developer tools for your Redux/Angular apps, speeding your development build

Features

  • Lets you inspect every state and action payload
  • Lets you go back in time by “cancelling” actions

Overview

The Angular Redux DevTools are largely inspired by DockMonitor and LogMonitor with a bit changes to adapt them to the Angular environment. You need to still be careful to not include these tools into production environment. This version is not using the base Redux DevTools because it requires to have React in your project. Any suggestions or improvements are welcome. Make sure to follow advices given by Dan Abramov on Redux DevTools because they basically work basically the same.

Instalation

npm install --save-dev ng-redux-dev-tools

Usage

DevTools are pretty easy to use in Angular, everything you have to do is :

  • Import the Angular module ngReduxDevTools
  • Use the devToolsServiceProvider.instrument store enhancer
  • Add the monitors you want (dock-monitor and log-monitor are packaged with the tools) directive to your main HTML file and you're ready to go !

Here's an example :

index.js


import {module} from 'angular';
import ngRedux from 'ng-redux';
import ngReduxDevTools from 'ng-redux-dev-tools';

import reducer from './reducer';

module('myApp', [ngRedux, ngReduxDevTools])
  .config(function ($ngReduxProvider, devToolsServiceProvider) {
    'ngInject';
    
    $ngReduxProvider.createStoreWith(reducer, [], [devToolsServiceProvider.instrument()]);
  });
  

index.html


<!doctype html>
<html lang="fr">
  <head>
    <meta charset="UTF-8">
    <title>Angular Redux DevTools</title>
  </head>
  <body ng-app="myApp">
    <dock-monitor>
      <log-monitor></log-monitor>
    </dock-monitor>
  </body>
</html>

That's it. Simple ? (The default key to show the DevTools is Ctrl-H)

API

See the API Reference.

Running example

Clone the project:

git clone https://github.com/D34THWINGS/ng-redux-dev-tools.git
cd ng-redux-dev-tools

Install npm packages in the root folder:

npm install

Install gulp on your machine if not already present:

npm install -g gulp

Finally run the following command:

gulp serve

It's a basic counter example, any changes made to the code (even in the example folder) will reload the browser automatically.

Custom Monitors

In the Angular version of the tools, it's event simpler to add a new monitor. Here what you need to do :

custom-monitor.js

// Stupid example that displays all staged actions
angular.module('ngCustomMonitor', ['ngRedux', 'ngReduxDevToolsServices'])
  .directive('customMonitor', function () {
    return {
      restrict: 'E',
      template: '<div class="custom-monitor">{{customMonitorCtrl.stagedActions}}</div>',
      controllerAs: 'customMonitorCtrl',
      controller(devToolsService, devToolsActionCreatorsService, $scope) {
        'ngInject';

        // Connect your controller to the dev tools
        const unsubscribe = devToolsService.connect()(state => state)(this);
        $scope.$on('$destroy', unsubscribe);

        // Do anything you want from here...

        // This is the dev tools store, if you want the application store, use $ngRedux
        this.store = devToolsService.store;

        // Dev tools implements basic action creators (reset, revert, sweep, commit, toggleAction, jumpToState)
        this.reset = function () {
          this.store.dispatch(devToolsActionCreatorsService.reset());
        };
      }
    };
  })
  .config(function (devToolsServiceProvider) {
    'ngInject';

    // Register a custom reducer on the dev tool store allowing us to use redux to manage state of tools
    // without polluting you application state
    devToolsServiceProvider.registerReducer((state, action) => {
      if (action.type === 'FOO') {
        return {foo: 'bar'};
      }

      return state;
    });
  });

See this issue if you want to learn more about what thing are available to you in the dev tool state and what action you can perform

Licence

MIT