Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapter docs: document ES2015 entry point #1484

Merged
merged 1 commit into from
Jan 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion docs/adapters/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@ permalink: /docs/adapters/development/

## Adapter Basics

All adapters inherit from the Adapter class in the `src/adapter.coffee` file. There are certain methods that you will want to override. Here is a basic stub of what an extended Adapter class would look like:
All adapters inherit from the Adapter class in the `src/adapter.coffee` file. If you're writing your adapter in CoffeeScript, require the primary version of the adapter:

```coffee
Adapter = require('hubot').Adapter
```

If you're writing your adapter in ES2015, you must require the ES2015 entrypoint instead:

```js
const Adapter = require('hubot/es2015').Adapter;
```

There are certain methods that you will want to override. Here is a basic stub of what an extended Adapter class would look like:

```coffee
class Sample extends Adapter
Expand Down