Comments (11)
Should the typings of Iterable<K, V>
be updated to include the method?
[Symbol.iterator](): Iterator<T>;
I'm not sure this is the right way for 2 reasons:
- The Symbol symbol is declared only for TypeScript ES6 target - for backwards compatibility, should SymbolConstructor and Symbol be defined in immutable.d.ts also?
- From source it seems KeyedIterable returns entries() instead of values(), so the type of it is different. Maybe it's enough to override the iterable method in Iterable.Keyed to return the appropriate type instead.
from immutable-js.
0164a55 Adds Iterator methods to Vector, Map, Set, OrderedMap
from immutable-js.
049eff1 Adds ES6 Symbol.iterator polyfill
from immutable-js.
Hi,
I'm not sure it's the right place to ask/tell but I've tried to use orderedMap.values()
but the result does not seem to have a done
property nor next()
method. Is it a bug or am I just misusing it?
Thanks.
from immutable-js.
Hey Joseph, what version are you using?—
Sent from Mailbox
On Fri, Aug 29, 2014 at 1:51 AM, Joseph Silvestre
[email protected] wrote:
Hi,
I'm not sure it's the right place to ask/tell but I've tried to useorderedMap.values()
but the result does not seem to have adone
property nornext()
method. Is it a bug or am I just misusing it?Thanks.
Reply to this email directly or view it on GitHub:
#68 (comment)
from immutable-js.
Sorry, I've tried the latest one, 2.0.16
from immutable-js.
is there any way to create a lazy Sequence directly from an ES6 generator?
from immutable-js.
Not yet, but I have that on my short list!—
Sent from Mailbox
On Mon, Sep 22, 2014 at 8:54 PM, voodoohop [email protected]
wrote:
is there any way to create a lazy Sequence directly from an ES6 generator?
Reply to this email directly or view it on GitHub:
#68 (comment)
from immutable-js.
As of v2.3.0, all Sequences can be iterated and all collections can be constructed from an Iterator or Iterable.
from immutable-js.
From source it seems KeyedIterable returns entries() instead of values()
You hit the nail on the head here. This is the real issue with making the base class iterable. Consider the following function:
function f(iter: Iterable<A,B>): Array<?> {
out = [];
for (let x of iter) {
out.push(x);
}
return out;
}
What type belongs in ?
? If I pass a KeyedIterable
, it would be [K,V]
, if I pass anything else, it would be V
.
from immutable-js.
It seems then that Immutable.Iterable
itself should not be Iterable
in the ES6 sense (as defined in lib.core.es6.d.ts), because its type is ill-defined. Instead, Iterable.Indexed
and Iterable.Keyed
should be ES6-iterable. It's bit of a pain because the Iterable methods like map
aren't typed as returning this
, but it would still be better than nothing.
from immutable-js.
Related Issues (20)
- Converting a Seq to a list causes RangeError (max call size exceeded) HOT 1
- 4.2.0: partition missing in flow HOT 3
- Question: Wiki article for upgrading to v4 HOT 3
- `toJS` breaks type compatibility between records with object values HOT 8
- Wrong typescript declarations for `.update()` method (continued) HOT 2
- Record with more keys should be assignable to Record with less keys if type is a subset of the first one
- An argument for 'reviver' was not provided. HOT 4
- ReferenceError: Immutable is not defined HOT 9
- Highlight inputs where `Set` can't maintain uniqueness HOT 4
- Flow type definition outdated, not working with last year changes HOT 1
- Urgent: Package Installation Reveals Multiple Vulnerabilities HOT 1
- Type predicate missing on isOrderedSet function type declaration
- support deno HOT 2
- immutable default import in 5.x
- version 4.3.3 breaks TS/Angular/webpack HOT 2
- Typescript: Implement `MapOf::merge `
- Extract sort function from Collection types HOT 6
- Enhancement: Custom equals HOT 8
- Strange edge case with Map.update(...) HOT 3
- Moving off deprecated dependencies HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from immutable-js.