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

Ensure object property order #46

Closed
suguru03 opened this issue Jan 30, 2018 · 0 comments
Closed

Ensure object property order #46

suguru03 opened this issue Jan 30, 2018 · 0 comments
Assignees
Milestone

Comments

@suguru03
Copy link
Owner

Aigle functions should return the same order (it is not ensured by engines).

(async () => {
  const obj1 = {
    task1: Aigle.delay(30, 1),
    task2: Aigle.delay(20, 2),
    task3: Aigle.delay(10, 3)
  };
  const res1 = await Aigle.props(obj1);
  console.log(res1);
  // { task3: 3, task2: 2, task1: 1 }
  // ↓
  // { task1: 1, task2: 2, task3: 3 }

  const obj2 = {
    task1: 1,
    task2: 2,
    task3: 3
  };
  const res2 = await Aigle.mapValues(obj2, val => Aigle.delay(val * 10, val));
  console.log(res2);
  // { task3: 3, task2: 2, task1: 1 }
  // ↓
  // { task1: 1, task2: 2, task3: 3 }
})();
@suguru03 suguru03 added this to the v1.x milestone Jan 30, 2018
@suguru03 suguru03 self-assigned this Jan 30, 2018
@suguru03 suguru03 modified the milestones: v1.x, v1.11 Feb 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant