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

Update series.ts #272

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JacobWeisenburger
Copy link
Contributor

@JacobWeisenburger JacobWeisenburger commented Mar 14, 2023

Description

This change would allow using as const

const weekdays = [
    'monday',
    'tuesday',
    'wednesday',
    'thursday',
    'friday'
] as const

const weekdaysSeries = series( weekdays )

or

const weekdays = series( [
    'monday',
    'tuesday',
    'wednesday',
    'thursday',
    'friday'
] as const )

Fixes

Currently in the docs you have:

type Weekday = 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday'

const weekdays = series<Weekday>([
  'monday',
  'tuesday',
  'wednesday',
  'thursday',
  'friday'
])

But this is not needed duplication of the list of weekdays

items: T[] | readonly T[]
@vercel
Copy link

vercel bot commented Mar 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
radash-docs ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 14, 2023 at 7:42PM (UTC)

Copy link
Owner

@sodiray sodiray left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @JacobWeisenburger thanks for the PR, it looks like typing the items as a readonly array breaks the code just below. I like the change, would love to see you make it work if you're still interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants