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

version 2.10.0 rc.4 #1421

Merged
merged 10 commits into from
Mar 8, 2021
Merged

version 2.10.0 rc.4 #1421

merged 10 commits into from
Mar 8, 2021

Conversation

gcanti
Copy link
Owner

@gcanti gcanti commented Mar 4, 2021

Related: #1420

@gcanti gcanti merged commit 49a1ab8 into master Mar 8, 2021
@gcanti gcanti deleted the 2.10.0-rc.4 branch March 8, 2021 13:44
@SRachamim
Copy link
Contributor

SRachamim commented Mar 8, 2021

Why did we deprecate the empty instances? They were very useful when you want to create a stable reference for an empty array/record/map etc.

import * as A from 'fp-ts/ReadonlyArray'
import * as React from 'react'

import PureComponent from 'components/PureComponent'

interface Props<A> {
  readonly as?: ReadonlyArray<A>
}

const Component = <A>({ as = A.empty }: Props<A>) => (
  <PureComponent as={as} />
)

export default React.memo(Component)

Using [] as recommended is naive and won't work here.

What's the story with removing it? What is the trigger?

@gcanti
Copy link
Owner Author

gcanti commented Mar 8, 2021

@SRachamim ReadonlyArray's empty is not deprecated

@SRachamim
Copy link
Contributor

SRachamim commented Mar 8, 2021

Oh wow! That makes sense now!

Great change! :)

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.

2 participants