question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Grid is not calling `.map()`

See original GitHub issue

Here’s a test I wrote that is not throwing an error, but it should:

describe('rectangle()', () => {
  test('returns a new grid', () => {
    const grid = new Grid(createHexPrototype(), rectangle({ width: 2, height: 2 })).map((h) => h).run()
    const newGrid = grid.map((h) => {
      throw new Error('')
    })
    grid.run()
    newGrid.run()
  })
})

This test throws an error, as expected:

describe('rectangle()', () => {
  test('returns a new grid', () => {
-    const grid = new Grid(createHexPrototype(), rectangle({ width: 2, height: 2 })).map((h) => h).run()
+    const grid = new Grid(createHexPrototype(), rectangle({ width: 2, height: 2 })).map((h) => h) //.run()
+    grid.run()
    const newGrid = grid.map((h) => {
      throw new Error('')
    })
    grid.run()
    newGrid.run()
  })
})

version: 4.0.0-alpha.3

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
flauwekeulcommented, Aug 17, 2022

🎉 This issue has been resolved in version 4.0.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

1reaction
flauwekeulcommented, Apr 13, 2021

I just released alpha.4. It contains a ring() and spiral() traverser and I’ve tried to fix the duplicate hexes that chaining traversers caused. I’m looking forward to your opinion (of course it’s fine if you don’t want to).

I took a quick look at your app, it looks nice and clean. Unfortunately, I don’t know the rules of the game, so I have no idea how to play it. But any game that uses hexagons is worth playing, so I’ll learn this when I have more time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS grid does not place items created with React and array.map
I am working on a React challenge to create a calculator. I render the buttons using React functional components and I plan to...
Read more >
TypeError Handling in React.js for Map Function | Pluralsight
This error occurs because your data is not an array. The .map() function only works with arrays. First, you'll need to confirm your...
Read more >
Getting Started with Drawing Tools | Google Earth Engine
Maps don't get drawing tools by default, but we can add drawing tools to newly created maps by simply calling the drawingTools() method...
Read more >
What are grids and graticules?—Help | ArcGIS for Desktop
A grid is a network of evenly spaced horizontal and vertical lines used to identify locations on a map. Graticules are lines showing...
Read more >
2-D and 3-D grids - MATLAB meshgrid - MathWorks
This MATLAB function returns 2-D grid coordinates based on the coordinates contained in vectors x and y.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found