Package Exports
- rijs.helpers
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rijs.helpers) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Ripple | Helpers
Allows registering helper functions for a resource.
export default {
name: 'foo'
, body: { bar: 1 }
, headers: { helpers: { help, constant: 5 } }
}
function help(){ return 'help!' }You will be able to access the helper functions from the resource itself, on the server or client, even if you overwrite the entire resource body:
ripple('foo').help() // 'help!'
ripple('foo').constant // 5
ripple('foo', { bar: 2 })
ripple('foo').help() // 'help!'
ripple('foo').constant // 5