MCPcopy Create free account
hub / github.com/dresende/node-orm2 / waitHooks

Function waitHooks

lib/Instance.js:174–189  ·  view source on GitHub ↗
(hooks, next)

Source from the content-addressed store, hash-verified

172 return data;
173 };
174 var waitHooks = function (hooks, next) {
175 var nextHook = function () {
176 if (hooks.length === 0) {
177 return next();
178 }
179 Hook.wait(instance, opts.hooks[hooks.shift()], function (err) {
180 if (err) {
181 return next(err);
182 }
183
184 return nextHook();
185 });
186 };
187
188 return nextHook();
189 };
190 var saveNew = function (saveOptions, data, cb) {
191 var i, prop;
192

Callers 1

saveInstanceFunction · 0.85

Calls 1

nextHookFunction · 0.85

Tested by

no test coverage detected