jkuester:reactive-stack

v1.0.0Published 4 months ago

Meteor Reactive Stack

A simple reactive stack implementation, works with any frontend.

  • Article
  • Video Tutorial

Installation

meteor add jkuester:reactive-stack

Usage

1import { ReactveStack } from "meteor/jkuester:reactive-stack";
2import { Tracker } from 'meteor/tracker'
3
4const stack = new ReactveStack()
5
6Tracker.autorun(() => {
7  // reactively updates, once items 
8  // are psushed to or popped from
9  // the stack
10  const top = stack.peek()
11  console.debug(top)
12})
13
14// ...
15
16stack.push('foo')
17stack.push('bar')
18stack.push('baz')
19stack.push('moo')

The full api is documented in api.md

Run the tests

meteor test-packages ./