Context

Context

new Context(store, data, previous, raw, cb)

The data context passing within local and global events.
Parameters:
Name Type Description
store Store The store
data object The data
previous object The previous data
raw object The raw data entered
cb Context~callback The callback function
Properties:
Name Type Description
internal boolean Whether the underlying Store is in internal mode or not
store Store The store
req HttpRequest The http request object
res HttpResponse The http response object
data object The data
previous object The previous data
raw object The raw data entered
Tutorials:

Methods

changed(name) → {boolean}

Check if a property value has changed.
Parameters:
Name Type Description
name string The property name
Returns:
Type
boolean

done()

Complete the process.

error(code, err)

Throw an error and halt the process.
Parameters:
Name Type Description
code number | string | object The error status code or the error object
err string | object The error object or message

hide(name)

Hide a property from the resulting data.
Parameters:
Name Type Description
name string The property name

validate(schema) → {object}

Validate the data against a json schema.
Parameters:
Name Type Description
schema object The validation schema
Returns:
Type
object

Type Definitions

callback(err, res)

Parameters:
Name Type Description
err Exception The exception object
res object The delete results