No description, website, or topics provided.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
examples
lib
.babelrc
.editorconfig
.gitignore
.travis.yml
LICENSE
README.md
bower.json
package.json
yarn.lock

README.md

Dumdum Js

DumDum is a condtional JavaScript executor, or a router if you will. Routes are executed based on class names on the body element. DumDum has no dependencies. Is nice!

NPM version NPM downloads Build status Test coverage

Installation

npm install dumdum-js --save

Usage

CommonJs:

var DumDum = require('dumdum-js')

ES6:

import DumDum from 'dumdum-js'

Using it in your javascript:

new DumDum({
  common: function() {
    // Generic JS here.
  },
  home: function() {
    // JS for pages containing the 'home' class
  },
  nav_ready: function() {
    // Will be executed as soon as the 'nav-ready' class is added to the body.
  }
})

This will enable DumDum to watch for changes to your body element.

If you need to watch for changes you can pass it as the second argument.

License

MIT license