A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://keystonejs.github.io/grappling-hook/module-grappling-hook.html below:

JSDoc: Module: grappling-hook

Module: grappling-hook Methods (static) attach(base, presetsopt, optsopt) → {function}

Attaches GrapplingHook methods to base's prototype.

Parameters: Name Type Attributes Description base function presets string <optional>

presets name, see set

opts options <optional>

options.

Mixes In:
Source:
See:
Returns:
Type
function
Example
var grappling = require('grappling-hook');
var MyClass = function() {
};
MyClass.prototype.save = function(done) {
  console.log('save!');
  done();
};
grappling.attach(MyClass); // attach grappling-hook functionality to a 'class'
(static) create(presetsopt, optsopt) → {GrapplingHook}

Creates an object with GrapplingHook functionality.

Parameters: Name Type Attributes Description presets string <optional>

presets name, see set

opts options <optional>

options.

Source:
See:
Returns:
Type
GrapplingHook
Example
var grappling = require('grappling-hook');
var instance = grappling.create(); // create an instance
(static) get(name) → {*}

Retrieves presets stored as name. Or a specific value of a preset. (The use of namespaces is to avoid the very unlikely case of name conflicts with deduped node_modules)

Parameters: Name Type Description name string
Since:
Source:
See:
Returns:
Type
*
Examples
grappling.get('grapplinghook:example.qualifiers.pre');
grappling.get('grapplinghook:example.qualifiers');
grappling.get('grapplinghook:example');
(static) isThenable(subject) → {Boolean}

Determines whether subject is a thenable.

Parameters: Name Type Description subject *
Source:
See:
Returns:
Type
Boolean
(static) mixin(instance, presetsopt, optsopt) → {GrapplingHook}

Mixes GrapplingHook methods into instance.

Parameters: Name Type Attributes Description instance Object presets string <optional>

presets name, see set

opts options <optional>

options.

Mixes In:
Source:
See:
Returns:
Type
GrapplingHook
Example
var grappling = require('grappling-hook');
var instance = {
};
grappling.mixin(instance); // add grappling-hook functionality to an existing object
(static) set(name, options) → {module:grappling-hook}

Store presets as name. Or set a specific value of a preset. (The use of namespaces is to avoid the very unlikely case of name conflicts with deduped node_modules)

Parameters: Name Type Description name string options options
Since:
Source:
See:
Returns:
Type
module:grappling-hook
Examples
//index.js - declaration
var grappling = require('grappling-hook');
grappling.set('grapplinghook:example', {
  strict: false,
  qualifiers: {
    pre: 'before',
    post: 'after'
  }
});

//foo.js - usage
var instance = grappling.create('grapplinghook:example'); // uses options as cached for 'grapplinghook:example'
grappling.set('grapplinghook:example.qualifiers.pre', 'first');
grappling.set('grapplinghook:example.qualifiers.post', 'last');

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4