-
emit(id, packet)
-
Emit an event with given id
Parameters:
Name |
Type |
Description |
id |
string
|
Id of the event to emit |
packet |
Object
|
Data packet to emit |
- Source:
-
-
fromNow(d [, now])
-
Returns the number of milliseconds between now and a given date
Parameters:
Name |
Type |
Argument |
Description |
d |
string
|
|
The date from which the current time will be subtracted |
now |
function
|
<optional>
|
A function that returns the current UNIX time in milliseconds |
- Source:
-
Returns:
-
Type
-
number
-
get( [language])
-
get a specific worldstate version
Parameters:
Name |
Type |
Argument |
Default |
Description |
language |
string
|
<optional>
|
'en'
|
Locale of the worldsttate |
- Source:
-
Throws:
-
when the platform or locale aren't tracked and aren't updated
-
-
Type
-
Error
Returns:
Worldstate corresponding to provided data
-
Type
-
Object
-
<async> getData()
-
Get the current data or a promise with the current data
- Source:
-
Returns:
either the current data
if it's not updating, or the promise returning the new data
-
Type
-
Promise.<Object>
|
Object
-
<async> getParseableData()
-
Get data able to be parsed from twitter.
- Source:
-
Returns:
Tweets
-
Type
-
Promise.<Array.<Object>>
-
initCycleStart(deps)
-
Set up current cycle start if it's not been initiated
Parameters:
Name |
Type |
Description |
deps |
Deps
|
dependencies for processing |
- Source:
-
-
onError(error)
-
Handle errors that arise while fetching data from twitter
Parameters:
Name |
Type |
Description |
error |
Error
|
twitter error |
- Source:
-
-
parseEvents(worldstate, platform [, language])
-
Parse new worldstate events
Parameters:
Name |
Type |
Argument |
Default |
Description |
worldstate |
Object
|
|
|
worldstate to find packets from |
platform |
string
|
|
|
platform the worldstate corresponds to |
language |
string
|
<optional>
|
'en'
|
language of the worldstate (defaults to 'en') |
- Source:
-
-
<async> setUpRawEmitters()
-
Set up emitting raw worldstate data
- Source:
-
-
setupParsedEvents()
-
Set up listeners for the parsed worldstate updates
- Source:
-
-
<async> update()
-
Force the cache to update
- Source:
-
Returns:
the currently updating promise.
-
Type
-
Promise