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

refactor(core): useMutableSource emulation without symbol and any #646

Merged
merged 1 commit into from
Aug 9, 2021

Conversation

dai-shi
Copy link
Member

@dai-shi dai-shi commented Aug 9, 2021

This is to follow pmndrs/valtio#208 (we use the same code.)

@Thisen once suggested to have precise typing in useMutableSource.ts. This covers it.

@dai-shi dai-shi requested a review from Thisen August 9, 2021 01:08
@vercel
Copy link

vercel bot commented Aug 9, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pmndrs/jotai/4CTYPzS41DSpHonWjmNezSKWkWAv
✅ Preview: https://jotai-git-refactor-use-mutable-source-pmndrs.vercel.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 9, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 327c1c5:

Sandbox Source
React Configuration
React Typescript Configuration

@dai-shi dai-shi mentioned this pull request Aug 9, 2021
@@ -9,20 +9,28 @@ export {

import { useEffect, useRef, useState } from 'react'

const TARGET = Symbol()
const GET_VERSION = Symbol()
const TARGET = '_uMS_T'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why remove the use of Symbol?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because, with internal symbols, TS can't emit types properly. That's why any was used.

@dai-shi dai-shi merged commit 7a04867 into master Aug 9, 2021
@dai-shi dai-shi deleted the refactor/use-mutable-source branch August 9, 2021 22:48
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