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

Breaking change 0.x release: Sequence.define #45

Closed
alexgorbatchev opened this issue Nov 8, 2013 · 3 comments
Closed

Breaking change 0.x release: Sequence.define #45

alexgorbatchev opened this issue Nov 8, 2013 · 3 comments

Comments

@alexgorbatchev
Copy link

0.2 init no loger takes parent as first argument

0.1 version

lazy.Sequence.define 'indexBy',
  init: (@parent, @keyFn) ->
    if typeof @keyFn is 'string'
      keyStr = @keyFn
      @keyFn = (item) -> item[keyStr]
  each: (fn) ->
    for value in @parent
      fn([@keyFn(value), value])

0.2 version

lazy.Sequence.define 'indexBy',
  init: (@keyFn) ->
    if typeof @keyFn is 'string'
      keyStr = @keyFn
      @keyFn = (item) -> item[keyStr]
  each: (fn) ->
    for value in @parent
      fn([@keyFn(value), value])

Sorry about CoffeeScript but I think you get the gist.

@dtao
Copy link
Owner

dtao commented Nov 8, 2013

You're right—I removed this because felt like it was an unnecessary requirement that just made the API less friendly. Now Lazy automatically assigns the parent so there is better consistency: indexBy("foo") means init will be called with "foo".

One thing is clear: I should start providing release notes/change lists with each release.

Do you have strong objections to this particular change? I do apologize that you had to discover this on your own; but in terms of what the interface should be, I'm hoping you agree with me that requiring parent to be the first parameter was pretty awkward?

@alexgorbatchev
Copy link
Author

@dtao change in this case would be super awesome! I wanted to flag this change for anyone having the same problem. Personally, I do agree with you and prefer 0.2 API.

It probably makes sense to keep this issue open for some time so that others could refer to this.

@dtao
Copy link
Owner

dtao commented Feb 5, 2018

Closing this. It's been open "for some time"—over 4 years now! ;)

@dtao dtao closed this as completed Feb 5, 2018
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