Skip to content

rijs/helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
pemrouz
Aug 22, 2016
894fc2d · Aug 22, 2016

History

26 Commits
Aug 22, 2016
Aug 22, 2016
Nov 18, 2015
Oct 23, 2015
Dec 19, 2015
May 2, 2016
Aug 22, 2016
Aug 22, 2016

Repository files navigation

Ripple | Helpers

Coverage Status Build Status

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

Packages

No packages published