Skip to content

Commit a9b303d

Browse files
committed
feat: add ability to customize columns
1 parent b3dffd9 commit a9b303d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/makeSelector.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export function makeSelector<OtherOptions, Client, Page, Item, Id>({
108108
refetchRecent,
109109
getItems,
110110
getId,
111-
columns,
111+
columns: defaultColumns,
112112
}: {
113113
thing: string
114114
things?: string
@@ -135,7 +135,6 @@ export function makeSelector<OtherOptions, Client, Page, Item, Id>({
135135
getSearchText?: (item: Item) => string | undefined
136136
columns: Columns<Item>
137137
}) {
138-
const createTitle = makeCreateTitle(columns)
139138
return async (
140139
{
141140
client = getClient({}),
@@ -147,6 +146,7 @@ export function makeSelector<OtherOptions, Client, Page, Item, Id>({
147146
style,
148147
clearFirst,
149148
filterItems = () => true,
149+
columns = defaultColumns,
150150
...rest
151151
}: {
152152
client?: Client
@@ -158,8 +158,11 @@ export function makeSelector<OtherOptions, Client, Page, Item, Id>({
158158
stdin?: Readable
159159
stdout?: Writable
160160
filterItems?: (item: Item) => boolean
161+
columns?: Columns<Item>
161162
} & OtherOptions = {} as any
162163
): Promise<Item> => {
164+
const createTitle = makeCreateTitle(columns)
165+
163166
const region = await (client as any).config.region()
164167
if (!message) {
165168
message = `Select ${

0 commit comments

Comments
 (0)