Coder Social home page Coder Social logo

digest.js's Introduction

#Digest.js ######My first experiment writing a JS library. Light-weight, dependency-free, no-fat-no-frills Publish/Subscribe

####What is Digest.js? Look up. Those words describe the essence of Digest.js, but in case you haven't had your fill of buzzwords yet, Digest.js is an open-source, light-weight, dependency-free, no-fat-no-frills Publish/Subscribe library for Javascript environments. Digest.js should work in any Javascript environment, including Node.js (untested) and the browser (tested in recent Chrome).

####How can I use it? Simply add Digest.js to your HTML page, or import it with a script loader like require.js. It instantiates itself, and then attaches itself to the global variable Digest. Look at the example for more.

####Usage example

//Subscribe to the "arrived" topic
//When the topic comes in, the function
//will be called
Digest.sub("arrived", function (data) {
	console.log("the journey to" + data + " is over");
});

//Publish the "arrived" topic
Digest.pub("arrived", "Washington, DC"); 
//console.logs "the journey to Washington, DC is over"

####Why did you write yet another Publish/Subscribe library for Javascript?

I thought there weren't enough already. Just kidding! Seriously, I wrote Digest.js for two reasons:

  • Practice. I'm looking to build a portfolio and expand my knowledge of object-oriented Javascript.
  • Issues while another Javascript Publish/Subscribe library (that turned out to not be related to the library. #faceplant)

####Looks like you've put some effort in, but this could use some more work before it's ready for prime-time.

Yep. The future for Digest.js looks interesting: it needs (loads of) testing, (some) refactoring, and (complete) documentation. I see two roads for Digest.js: either I will chip away at these issues, or it will languish in the dark, unexplored corners of my Github. If you find it helpful, let me know - that would motivate me to do more development!

digest.js's People

Contributors

tjons avatar

Watchers

James Cloos avatar  avatar

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.