Skip to content

Commit 7b8488b

Browse files
committed
feat(compose): expose composeUniqueIssue method
closes #2
1 parent a84956b commit 7b8488b

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ Load `octokit-plugin-unique-issue` and [`@octokit/core`](https://github.com/octo
2020
```html
2121
<script type="module">
2222
import { Octokit } from "https://cdn.skypack.dev/@octokit/core";
23-
import { uniqueIssue } from "https://cdn.skypack.dev/octokit-plugin-unique-issue";
23+
import {
24+
uniqueIssue,
25+
composeUniqueIssue,
26+
} from "https://cdn.skypack.dev/octokit-plugin-unique-issue";
2427
</script>
2528
```
2629

@@ -35,7 +38,10 @@ Install with `npm install @octokit/core octokit-plugin-unique-issue`. Optionally
3538

3639
```js
3740
const { Octokit } = require("@octokit/core");
38-
const { uniqueIssue } = require("octokit-plugin-unique-issue");
41+
const {
42+
uniqueIssue,
43+
composeUniqueIssue,
44+
} = require("octokit-plugin-unique-issue");
3945
```
4046

4147
</td></tr>
@@ -96,6 +102,20 @@ if (closed_issues.length) {
96102
}
97103
```
98104

105+
### Direct usage (not as a plugin)
106+
107+
```js
108+
const octokit = new Octokit({ auth: "secret123" });
109+
110+
const { data, updated } = await composeUniqueIssue(octokit, {
111+
identifier: "super-unique-identifier",
112+
owner: "tmelliottjr",
113+
repo: "octokit-plugin-unique-issue",
114+
title: "My unique issue",
115+
body: "The body of my unique issue!",
116+
});
117+
```
118+
99119
## Options
100120

101121
<table width="100%">

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
import { VERSION } from "./version";
77
import { composeUniqueIssue } from "./compose-unique-issue";
88

9+
export { composeUniqueIssue } from "./compose-unique-issue";
910

1011
export function uniqueIssue(octokit: Octokit) {
1112
return {

0 commit comments

Comments
 (0)