Please clarify using `DataType` for code completion
See original GitHub issueHey, I’m having some trouble with code completion when I do this in my code:
export const loginObservable = createReactObservable<{ user: User | null }>(...)
The code that uses the above:
import { loginObservable } from "user"; // some imported workspace module
const {
ObservableProvider: LoginProvider,
useObservable: useLoginObservable,
} = loginObservable;
function App() {
const { data } = useLoginObservable();
///...
Now, in VS Code, when I type data.
I don’t get any suggestions for ‘user’ whatsoever. I dug into the library’s types and found:
export type DataType<T> = T | T[] | undefined;
Which is a bit unclear to me. Values in the ‘event bus’ can be either arrays or singular values? If so how would I use this with proper type checking? Thanks.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
How to Select the Right Data Types | Tutorial by Chartio
This tutorial will explain how to select the right data types. What are Data Types? Data types define what kind and range of...
Read more >Python: tell my IDE what type an object is - Stack Overflow
So, when I want code completion for help I just instantiate the variable to the type I want and then type ".", for...
Read more >Data Types in C: Derived and Modifiers | Simplilearn
Check out the data types in C and learn how to implement them while creating programs. Gain an in-depth knowledge of derived, user-defined ......
Read more >Data types in Java - GeeksforGeeks
Data types are different sizes and values that can be stored in the variable that is made as per convenience and circumstances to...
Read more >Oracle Data Types with Examples - Complete Guide
In this article, you will learn all about built-in Oracle data types - Character, Numeric, Object, DATE, LOB, RAW and LONG RAW, ROWID...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @luistak, forgive me for being so late in response!
Your API suggestion looks good. I’d however considered adding a limit to the length of values kept in
every
just to prevent potential memory issues. Maybe you could use an API like so for every:Also, consider
all
orlast
as an alternative variable name thanevery
.Hi @amireldor the new major version was released along with the improvements we discussed, feel free to use it and please give us feedback if you find any problems or feedback.