Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

Bug 744514 - Observer callbacks get topic as argument #592

Closed
wants to merge 1 commit into from

Conversation

gregglind
Copy link
Contributor

@@ -59,7 +59,8 @@ const Observer = Class({
this.listener({
type: topic,
subject: subject,
data: data
data: data,
topic: topic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

topic is already exposed via type property, is this really necessary ?

@gregglind
Copy link
Contributor Author

Gozala, this should be better.

let uu = function() uuid().number.slice(1,-1);

var counter = {};
let uuids = [uu() for (ii in [0,1,2,3,4,5])];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please don't use comprehensions ? We banned them as it's was not obvious for people that are unfamiliar and they don't buy us much to be worth the traideoffs.

let uuids = Array(5).map(uu) 

Is both shorter and simpler.

@gregglind
Copy link
Contributor Author

Any progress on this one?

@Gozala
Copy link
Contributor

Gozala commented Nov 26, 2012

Hey I'm really sorry for the delay, please mention @Gozala on the threads where you expect me to followup that way it'll be in the top of my message queue and I'll be getting to it sooner 😉

I think it's ready to go, it just won't merge through github interface as pr is out of date I presume. Could you please update and land it just make sure to add r=@gozala if you don't have privileges to do that mention me and I'll land it!

Thanks

@@ -6,6 +6,7 @@ const observers = require("sdk/deprecated/observer-service");
const { Cc, Ci } = require("chrome");
const { Loader } = require("sdk/test/loader");
const { PlainTextConsole } = require("sdk/console/plain-text");
const {uuid} = require('sdk/util/uuid');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: We put spaces after brackets and try to be consistent in quotes at least with in the file.

@Gozala
Copy link
Contributor

Gozala commented Dec 14, 2012

At this point system/events can be used with a * event type, where listeners are called with event.type set to the topic of the notification. There for this is obsolete we'll be deprecating observer-service and removing it, so I don't think this is anymore relevant.

@Gozala Gozala closed this Dec 14, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants