Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

Make default optional for atoms #1639

Closed

Conversation

drarmstr
Copy link
Contributor

Summary:
Make default an optional property for atoms. If not provided the atom will initialize in a pending state until set.

This can be convenient to avoid having to make an atom with some nullable type or trying to come up with a default placeholder or using something cryptic like default: new Promise(() => {}),

Reviewed By: habond

Differential Revision: D34488397

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported labels Feb 25, 2022
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D34488397

Summary:
Pull Request resolved: facebookexperimental#1639

Make `default` an optional property for `atom()` and `atomFamily()`.  If not provided, the atom will initialize in a pending state until set.

This can be convenient to avoid having to make an atom with some nullable type or trying to come up with a default placeholder or using something cryptic like `default: new Promise(() => {}),`

Reviewed By: habond

Differential Revision: D34488397

fbshipit-source-id: 4615b258146d2d3bed902008179868b179028ad3
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D34488397

drarmstr added a commit to drarmstr/Recoil that referenced this pull request Feb 26, 2022
Summary:
Pull Request resolved: facebookexperimental#1639

Make `default` an optional property for atoms.  If not provided the atom will initialize in a pending state until set.

This can be convenient to avoid having to make an atom with some nullable type or trying to come up with a default placeholder or using something cryptic like `default: new Promise(() => {}),`

Differential Revision: D34488397

fbshipit-source-id: e12e7f8cc05b342bf19307c2af8c06468e4283e1
drarmstr added a commit to drarmstr/Recoil that referenced this pull request Feb 26, 2022
Summary:
Pull Request resolved: facebookexperimental#1639

Make `default` an optional property for atoms.  If not provided the atom will initialize in a pending state until set.

This can be convenient to avoid having to make an atom with some nullable type or trying to come up with a default placeholder or using something cryptic like `default: new Promise(() => {}),`

Differential Revision: D34488397

fbshipit-source-id: 0afdfa5a6b10bb407e791ebbb3f19da754530744
drarmstr added a commit to drarmstr/Recoil that referenced this pull request Feb 26, 2022
Summary:
Pull Request resolved: facebookexperimental#1639

Make `default` an optional property for atoms.  If not provided the atom will initialize in a pending state until set.

This can be convenient to avoid having to make an atom with some nullable type or trying to come up with a default placeholder or using something cryptic like `default: new Promise(() => {}),`

Differential Revision: D34488397

fbshipit-source-id: b45ce52a634fbc24e696924757eb56aba333bb82
@drarmstr drarmstr self-assigned this Mar 3, 2022
@drarmstr drarmstr added the enhancement New feature or request label Mar 3, 2022
@drarmstr drarmstr deleted the export-D34488397 branch April 1, 2022 23:34
AlexGuz23 pushed a commit to AlexGuz23/Recoil that referenced this pull request Nov 3, 2022
Summary:
Pull Request resolved: facebookexperimental/Recoil#1639

Make `default` an optional property for `atom()` and `atomFamily()`.  If not provided, the atom will initialize in a pending state until set.

This can be convenient to avoid having to make an atom with some nullable type or trying to come up with a default placeholder or using something cryptic like `default: new Promise(() => {}),`

Reviewed By: habond

Differential Revision: D34488397

fbshipit-source-id: 72b211b7b542ad51d2568cfeb103917b5d29fcea
snipershooter0701 pushed a commit to snipershooter0701/Recoil that referenced this pull request Mar 5, 2023
Summary:
Pull Request resolved: facebookexperimental/Recoil#1639

Make `default` an optional property for `atom()` and `atomFamily()`.  If not provided, the atom will initialize in a pending state until set.

This can be convenient to avoid having to make an atom with some nullable type or trying to come up with a default placeholder or using something cryptic like `default: new Promise(() => {}),`

Reviewed By: habond

Differential Revision: D34488397

fbshipit-source-id: 72b211b7b542ad51d2568cfeb103917b5d29fcea
eagle2722 added a commit to eagle2722/Recoil that referenced this pull request Sep 21, 2024
Summary:
Pull Request resolved: facebookexperimental/Recoil#1639

Make `default` an optional property for `atom()` and `atomFamily()`.  If not provided, the atom will initialize in a pending state until set.

This can be convenient to avoid having to make an atom with some nullable type or trying to come up with a default placeholder or using something cryptic like `default: new Promise(() => {}),`

Reviewed By: habond

Differential Revision: D34488397

fbshipit-source-id: 72b211b7b542ad51d2568cfeb103917b5d29fcea
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. enhancement New feature or request fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants