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

Immutable size / length ?? #14

Open
bleucitron opened this issue Nov 5, 2015 · 3 comments
Open

Immutable size / length ?? #14

bleucitron opened this issue Nov 5, 2015 · 3 comments

Comments

@bleucitron
Copy link
Contributor

in server/src/main.js, i try to log the size of an Immutable List<BinData>.

console.log('SAVING BIIIIIIIIINS !!!', data.action.bins.length, data.action.bins.size);

I get a TS warning: server/src/main.ts(46,60): error TS2339: Property 'length' does not exist on type 'List<BinData>'.
The length outputs the correct length, while size outputs undefined...

@DavidBruant
Copy link
Contributor

blargh. Probably wrong tsd :-/

@bleucitron
Copy link
Contributor Author

No, what's weird is i should be able to output the size, since it's an Immutable... I don't really care about the TS warning.
It's as if my Immutable List acted as a regular Array...

@DavidBruant
Copy link
Contributor

hmm... Try Array.isArray(data.action.bins) ?

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

No branches or pull requests

2 participants