slackapi / node-slack-interactive-messages

Slack Buttons, Menus, and Dialogs made simpler for Node
MIT License
133 stars 41 forks source link

Should adapter.dispatch() be async? #30

Closed aoberoi closed 6 years ago

aoberoi commented 6 years ago

Description

pro:

con:

we want to sort this out before any additional server interfaces are created (in addition to adapter.expressMiddleware().

a proposed interface using typescript syntax for illustration:

interface JSONObject {}; // what you might expect

interface DispatchResult {
  status: number;
  content?: string | JSONObject;
};

// if this function returns undefined, then there was no matching callback and the server should proceed to another handler
adapter.dispatch(payload: JSONObject): Promise<DispatchResult>?;

Requirements

aoberoi commented 6 years ago

now that the con's are sorted away, i think the answer here is yes!