~kylep/pipes

4de95e66b0688589c6af644f643bdcf7e1689367 — Kyle Perik a month ago fe7ba8c
Support array set at, handle missing el type
2 files changed, 8 insertions(+), 2 deletions(-)

M src/device.js
M src/utils.js
M src/device.js => src/device.js +1 -1
@@ 120,7 120,7 @@ function drawRendered (render, pos) {
      ? vecadd(pos, render.el.pos)
      : pos
  )
  if (render.el) {
  if (render.el && render.el.type) {
    draw(render.el, newPos)
  }
  // Either way, draw each of the children as well

M src/utils.js => src/utils.js +7 -1
@@ 42,9 42,15 @@ function withSetAtPath (paths, partial, data) {
    return data
  }
  const [path, ...otherPaths] = paths;
  const inner = withSetAtPath(otherPaths, (partial || {})[path], data)
  if (partial && Array.isArray(partial)) {
    const newPartial = partial.slice()
    newPartial[path] = inner
    return newPartial
  }
  return {
    ...(partial || {}),
    [path]: withSetAtPath(otherPaths, (partial || {})[path], data)
    [path]: inner
  }
}