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

$ObjMap property modifiers #7643

Closed
wants to merge 5 commits into from
Closed

Conversation

goodmind
Copy link
Contributor

@goodmind goodmind commented Apr 13, 2019

Related: #7639, #7571

Summary

Adds third argument to $ObjMap

Example

type Id = <T>(T) => T;

type Partial<T: {}> = $ObjMap<T, Id, { optional: true }>;
type Required<T: {}> = $ObjMap<T, Id, { optional: false }>;

type Readonly<T: {}> = $ObjMap<T, Id, { polarity: '+' }>;
type Writeonly<T: {}> = $ObjMap<T, Id, { polarity: '-' }>;
type ReadWrite<T: {}> = $ObjMap<T, Id, { polarity: 'N' }>;

// Regular $ObjMap still works

type Foo = $ObjMap<{|a: string|}, () => number>

@goodmind
Copy link
Contributor Author

@jbrown215 would you review this after you're done with spreads project instead of $Required pull request? Because #7571 was closed.
If you still work on spreads project then nevermind.

@goodmind
Copy link
Contributor Author

@jbrown215 anything about this?

@gkz
Copy link
Member

gkz commented Mar 10, 2023

We are working on implementing a version of mapped types instead of going with the approach of adding more features to $ObjMap.

@gkz gkz closed this Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants