You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
-39Lines changed: 0 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -173,45 +173,6 @@ Setting immediate exceptions in development is easy, just tell PubSubJS about it
173
173
PubSub.immediateExceptions=true;
174
174
```
175
175
176
-
## Plugin for jQuery
177
-
178
-
By default PubSubJS can be used in any browser or CommonJS environment, including [node](http://nodejs.org). Additionally, PubSubJS can be built specifically for jQuery using Rake.
179
-
180
-
$ rake jquery
181
-
182
-
or using Grunt
183
-
184
-
$ grunt jquery
185
-
186
-
Produces jquery.pubsub.js
187
-
188
-
### Use with jQuery
189
-
190
-
```javascript
191
-
var topic ='greeting',
192
-
data ='world',
193
-
subscriber=functionsayHello( data ){
194
-
console.log( 'hello '+ data );
195
-
};
196
-
197
-
// add a subscription
198
-
var token =$.pubsub('subscribe', topic, subscriber );
199
-
200
-
// unsubscribing
201
-
$.pubsub('unsubscribe', token); // remove a specific subscription
202
-
$.pubsub('unsubscribe', subscriber); // remove all subscriptions for subscriber
203
-
204
-
// publishing a topic
205
-
$.pubsub('publish', topic, data);
206
-
207
-
// publishing topic syncronously
208
-
$.pubsub('publishSync', topic, data);
209
-
```
210
-
211
-
In the jQuery build, the global ```PubSub``` global is still available, so you can mix and match both ```Pubsub``` and ```$.pubsub``` as needed.
212
-
213
-
There is also an article about [Using PubSubJS with jQuery](http://roderick.dk/resources/using-pubsubjs-with-jquery/)
0 commit comments