11# lfg-nucleus [ ![ Build Status] ( https://travis-ci.org/SupportClass/lfg-nucleus.svg?branch=master )] ( https://travis-ci.org/SupportClass/lfg-nucleus )
22> Meta bundle that ties together functionality from other "lfg" helper bundles.
33
4- < img src = " screenshot.png " />
4+ ![ screenshot] ( screenshot .png)
55
66lfg-nucleus is useful for normalizing and centrally managing events from multiple other bundles.
77At this time, lfg-nucleus integrates with:
88- [ lfg-hypetrain] ( https://github.com/SupportClass/lfg-hypetrain )
9- - [ lfg-siphon] ( https://github.com/SupportClass/lfg-siphon ) @~ 0.3 .0
10- - [ lfg-streamtip] ( https://github.com/SupportClass/lfg-streamtip ) @~ 0 .0.1
11- - [ lfg-sublistener] ( https://github.com/SupportClass/lfg-sublistener ) @^2 .0.0
9+ - [ lfg-siphon] ( https://github.com/SupportClass/lfg-siphon ) @~ 0.5 .0
10+ - [ lfg-streamtip] ( https://github.com/SupportClass/lfg-streamtip ) @~ 1 .0.0
11+ - [ lfg-sublistener] ( https://github.com/SupportClass/lfg-sublistener ) @^3 .0.0
1212
1313lfg-nucleus depends on:
14- - [ lfg-filter] ( https://github.com/SupportClass/lfg-filter ) @^2 .0.0
14+ - [ lfg-filter] ( https://github.com/SupportClass/lfg-filter ) @^3 .0.0
1515
1616## Using in your bundle
1717
18- lfg-nucleus emits two events: ` subscription ` and ` tip ` .
18+ lfg-nucleus emits three events: ` subscription ` , ` cheer ` , and ` tip ` .
1919
2020### In a graphic or dashboard panel
2121``` js
22- nodecg .listenFor (' subscription' , ' lfg-nucleus' , function ( subscription ) {
22+ nodecg .listenFor (' subscription' , ' lfg-nucleus' , subscription => {
2323 // do work
2424});
2525
26- nodecg .listenFor (' tip' , ' lfg-nucleus' , function (tip ) {
26+ nodecg .listenFor (' cheer' , ' lfg-nucleus' , cheer => {
27+ // do work
28+ });
29+
30+ nodecg .listenFor (' tip' , ' lfg-nucleus' , tip => {
2731 // do work
2832});
2933```
@@ -35,11 +39,15 @@ Then, create code like the following:
3539``` js
3640module .exports = function (nodecg ) {
3741 const nucleus = nodecg .extensions [' lfg-nucleus' ];
38-
42+
3943 nucleus .on (' subscription' , subscription => {
4044 // do work
4145 });
42-
46+
47+ nucleus .on (' cheer' , subscription => {
48+ // do work
49+ });
50+
4351 nucleus .on (' tip' , tip => {
4452 // do work
4553 });
@@ -78,14 +86,14 @@ module.exports = function (nodecg) {
7886 " timestamp" : 1456809533513 ,
7987 " id" : " 8f2ea9cb-2e8f-45dd-8645-0b724b2774f6" ,
8088 " read" : false ,
81- " type" : " tip" ,
82- " amount" : 5 ,
83- " currency" : " $" ,
84- " formattedAmount" : " $5" ,
89+ " type" : " cheer" ,
90+ " amount" : 1000 ,
91+ " formattedAmount" : " 1,000" ,
8592 " comment" : " Hi streamer!" ,
869394+ " profileUrl" : " https://twitch.tv/langeh" ,
8795
88- // Will be "daily" or "monthly" if this tip is the top tip of the day or month.
96+ // Will be "daily" or "monthly" if this tip is the top cheer of the day or month.
8997 " top" : null
9098}
9199```
0 commit comments