observ-grid-stack

2.0.1 • Public • Published

observ-grid-stack

Observe stacked array-grids (or observ-grid) of identical shape, falling back to grid below on coordinate value null.

Install via npm

$ npm install observ-grid-stack

API

var ObservGridStack = require('observ-grid-stack')

var gridStack = ObservGridStack([startStack])

Create an observable grid stack. Optionally specify an array of array-grids (or observ-grid) as startStack.

var remove = gridStack.push(grid)

Push an array-grid onto the stack. Non-null coordinate values will override the value directly below in the stack.

var removedGrid = gridStack.pop()

gridStack.get(row, col)

Resolve coordinates against flattened stack.

gridStack.index(row, col)

gridStack.lookup(row, col)

gridStack.coordsAt(row, col)

gridStack.update()

Simulates a nextTick, and computes immediately if any changes.

Observable Attributes

gridStack

Returns an array-grid based on flattened stack. Notifies on all changes to stack on nextTick.

gridStack.stack (ObservArray)

Modify directly or use gridStack.push(grid) and gridStack.pop().

/observ-grid-stack/

    Package Sidebar

    Install

    npm i observ-grid-stack

    Weekly Downloads

    3

    Version

    2.0.1

    License

    ISC

    Last publish

    Collaborators

    • mmckegg