Skip to content
This repository has been archived by the owner on Dec 26, 2021. It is now read-only.

Devel #5

Merged
merged 5 commits into from
Apr 19, 2017
Merged

Devel #5

merged 5 commits into from
Apr 19, 2017

Conversation

killix
Copy link
Collaborator

@killix killix commented Apr 18, 2017

No description provided.

@killix killix self-assigned this Apr 18, 2017
LICENCE.md Outdated

Version 3, 19 November 2007
Copyright 2009 Twitter, Inc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol bad copy past ;/

src/core/bot.ts Outdated
// it's an integration
if (instance.listen) {
this.logger.info({ method: 'use', message: `Integration: ${instance.serviceName()}` });
this.addIntegration(instance);
} else if (instance.receive || instance.send) { // Middleware
if (instance.receive) {
} else if (instance.incoming || instance.outgoing) { // Middleware
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could drop these as you do it again right after.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what do you mean?

Copy link
Contributor

@dustinblackman dustinblackman Apr 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like this, does it make sense?

  public use(instance: any, filter?: string | string[]): void {
    // it's an integration
    if (instance.listen) {
      this.logger.info({ method: 'use', message: `Integration: ${instance.serviceName()}` });
      this.addIntegration(instance);
    } else if(instance.incoming) {
      this.logger
        .info({ method: 'use', message: `incoming middleware: ${instance.serviceName()}` });
      this.incomingMiddlewares.push({
        name: `${instance.serviceName()}.incoming`,
        middleware: instance,
        filter: filter || null,
      });
    } else if (instance.outgoing) { // Middleware
      this.logger
        .info({ method: 'use', message: `outgoing middleware: ${instance.serviceName()}` });
      this.outgoingMiddlewares.push({
        name: `${instance.serviceName()}.outgoing`,
        middleware: instance,
        filter: filter || null,
      });
    }

    return;
  }

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 tired ;p

} from './interfaces';

const isObservable = (obs:any): boolean => obs && typeof obs.subscribe === 'function';
const isPromise = (obj:any): boolean =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does obj instanceof Promise not work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes is not work, weird...

@killix killix merged commit 37a097b into master Apr 19, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants