How to use the @feathersjs/commons.hooks.isHookObject function in @feathersjs/commons

To help you get started, we’ve selected a few @feathersjs/commons examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github feathersjs-ecosystem / feathers-sync / lib / core.js View on Github external
emit (event, data, ctx) {
        const disabled = ctx && ctx[SYNC] === false;

        if (!service._serviceEvents.includes(event) || disabled) {
          debug(`Passing through non-service event '${path} ${event}'`);
          return this._emit(event, data, ctx);
        }

        const context = hooks.isHookObject(ctx)
          ? _.omit(ctx, 'app', 'service') : ctx;

        debug(`Sending sync-out event '${path} ${event}'`);

        return app.emit('sync-out', app.sync.serialize({
          event, path, data, context
        }));
      }
    });