Members
(constant) MongoID :Object
Reference implementation of Meteor's MongoID
Type:
- Object
- Source:
(constant) SHA256 :function
1:1 copy of the Meteor SHA256 implementation
// TODO allow users to bring their own sha
Type:
- function
- Source:
(constant) hasOwn
Short for Object.prototype.hasOwnProperty.call
- Source:
(constant) localCollections
List of all local collections, whose names
are defined with `null`.
- Source:
Methods
close()
Attempts to close the socket.
Leads to emitting the 'close' event.
- Source:
Fires:
- event:'close' event
empty()
Clears all elements from the queue
- Source:
getObservers(type, collection, newDocument)
Get the list of callbacks for changes on a collection
Parameters:
| Name | Type | Description |
|---|---|---|
type |
string | Type of change happening. |
collection |
string | Collection it has happened on |
newDocument |
string | New value of item in the collection |
- Source:
hashPassword(password) → {Object}
Returns a Meteor-Accounts compatible password hash.
Parameters:
| Name | Type | Description |
|---|---|---|
password |
- Source:
Returns:
- Type
- Object
isPlainObject(obj) → {boolean}
Checks, whether a given object is a plain object,
as opposed to objects that are instances of a class
other than Object.
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
- Source:
Returns:
- Type
- boolean
isWindow(obj) → {boolean}
Ducktyping check if an object is the window object
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
- Source:
Returns:
- Type
- boolean
open()
Makes `open` a no-op if there's already a `rawSocket`.
This avoids memory / socket leaks if `open` is called twice (e.g. by a user
calling `ddp.connect` twice) without properly disposing of the
socket connection.
`rawSocket` gets automatically set to `null` only when it goes into a
closed or error state.
This way `rawSocket` is disposed of correctly: the socket connection is closed,
and the object can be garbage collected.
- Source:
Fires:
- event:'open' event
- event:'error' event
process()
Sync; processes the queue by each element, starting with the first
and passing each to the consumer.
- Source:
push(element)
Adds a new element to the queue
Parameters:
| Name | Type | Description |
|---|---|---|
element |
any | likely an object |
- Source:
send(object)
Sends a message out using the underlying
Websocket implementation.
Parameters:
| Name | Type | Description |
|---|---|---|
object |
object |
- Source:
stringify(value) → {string}
Use EJSON to strinify a given value
Parameters:
| Name | Type | Description |
|---|---|---|
value |
any |
- Source:
Returns:
- Type
- string
type(obj) → {string}
Attempts to reliably determine the type of a given value
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
any |
- Source:
Returns:
- Type
- string
uniqueId() → {string}
Returns an ever incrementing integer value as string
- Source:
Returns:
- Type
- string
withNoYieldsAllowed(f) → {function|*}
Takes a function `f`, and wraps it in a `Meteor._noYieldsAllowed`
block if we are running on the server. On the client, returns the
original function (since `Meteor._noYieldsAllowed` is a
no-op). This has the benefit of not adding an unnecessary stack
frame on the client.
Parameters:
| Name | Type | Description |
|---|---|---|
f |
function |
- Source:
Returns:
- Type
- function | *