downshift-js/downshift

TypeScript: have items and selectedItems as Readonly

Open

#1,030 opened on 2020年4月30日

GitHub で見る
 (4 comments) (1 reaction) (0 assignees)JavaScript (11,761 stars) (980 forks)batch import
TypeScripthelp wanted

説明

  • downshift version:
  • node version:
  • npm (or yarn) version:

Relevant code or config

What you did:

What happened:

Reproduction repository:

Problem description: Since we use items/selectedItems just for some logic and we do not tamper with them, we can mark them as read only in the TS interface.

Suggested solution: In typings.ts for useSelect, useCombobox and useMultipleSelection, use Readonly to wrap the items type.

コントリビューターガイド

TypeScript: have items and selectedItems as Readonly · downshift-js/downshift#1030 | Good First Issue