Giter VIP home page Giter VIP logo

publisher.js's Issues

Errors as AMD module with RequireJS Optimization

When run as an AMD module and optimized by @jrburke 's RequireJS, Publisher fails to be defined as a module. Instead an empty define('publisher', function(){}) is produced, breaking any code Publisher-dependent code.

Quoting @jrburke from ded/morpheus#19 , in which an identical problem and its solution are discussed:

The issue is that the requirejs optimizer uses an AST to find define() calls that look like AMD define calls. Since define(definition) is a bit too generic it skips it and puts in an empty module for the 'morpheus' name.

Two possible easy fixes:

  1. Use a function literal:

if (typeof define == 'function') define(function(){return definition()})

  1. Or just pass name to the function:

if (typeof define == 'function') define(name, definition)

Feature request: add a way to handle all messages of a topic

Whats currently missing is a way to subscribe to all messages of a topic or even all messages flowing to publisher to log them. This could be useful for automatically do something with sub topics which the system dosent know before.

An possible way to do this, would be something like that:

publisher.subscribe('sensors/*', function(data){
..
});

access the arguments in an after callback

the registration of an after callback is currently function(returnValue, object), ideally it should be something like function(returnValue, object, arg1, arg2, โ€ฆ) so that you can access the arguments without having to also create a before and cache them.

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.