# trackr

> A fork of Meteor Tracker.

Latest version **2.0.2** (published 2015-10-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install trackr
pnpm add trackr
yarn add trackr
bun add trackr
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2015-10-30 |
| First published | 2015-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Maintainers | mrgalaxy |
| Keywords | meteor, tracker, deps, dependencies, reactive, autorun, depend |

## Links

- npm: https://www.npmjs.com/package/trackr
- Repository: https://github.com/BeneathTheInk/trackr
- Homepage: https://github.com/BeneathTheInk/trackr#readme
- Issues: https://github.com/BeneathTheInk/trackr/issues
- npm.io page: https://npm.io/package/trackr

## Dependencies (1)

- [raf](https://npm.io/package/raf.md) ~3.1.0

## Recent versions

- 2.0.2 (latest) — 2015-10-30
- 2.0.1 — 2015-10-10
- 2.0.0 — 2015-08-19
- 1.0.3 — 2015-03-01
- 1.0.2 — 2015-02-21
- 1.0.1 — 2015-02-21
- 1.0.0 — 2015-02-09

## README

# Trackr

This is a fork of [Meteor Tracker](https://github.com/meteor/meteor/tree/devel/packages/tracker), the library formerly known as Meteor Deps. It has been repackaged into a standalone library that is ready to use in Node.js and the browser.

Trackr's API is completely backwards compatible with Meteor's version. If you are not familiar with Meteor Tracker, or reactive programming in general, I recommend reading the [Meteor Manual entry on Deps](http://manual.meteor.com/#deps). The concepts it teaches apply here as well.

## Install

Download the latest version from the [release page](https://github.com/BeneathTheInk/Trackr/releases) and use via a script tag. The variable `Trackr` will be attached to `window`.

```html
<script type="text/javascript" src="trackr.js"></script>
```

For Browserify and Node.js, install via NPM and require as necessary.

```sh
$ npm install trackr
```

```js
var Trackr = require("trackr");
```

## Usage

The only change that has been made is the addition of function context. Method context (`this`) can be added as an optional argument to the end of methods that accept functions. For example, here is how you would use `autorun()` with context:

```javascript
var ctx = { foo: "bar" };

var comp = Trackr.autorun(function() {
    console.log(this.foo); // "bar"
}, { /* options */ }, ctx);
```

This also works for `onInvalidate()` and `afterFlush()` callbacks. `onInvalidate()` will fallback on the context provided to the computation if none is provided.

```javascript
comp.onInvalidate(function() {
    console.log(this.foo); // "bar"
});

Trackr.afterFlush(function() {
    console.log(this.hello); // "world"
}, {
    hello: "world"
});
```

---
_Source: https://npm.io/package/trackr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
