Questions tagged [meteor-tracker]

Meteor Tracker is an tiny but powerful library for transparent reactive programming in JavaScript

Meteor Tracker is an incredibly tiny but incredibly powerful library for transparent reactive programming in JavaScript.

Tracker gives you much of the power of a full-blown Functional Reactive Programming (FRP) system without requiring you to rewrite your program as a FRP data flow graph - From https://www.meteor.com/tracker

49 questions
11
votes
1 answer

Meteor - Stop Tracker Autorun when Template is Destroyed (user leaves page)

In my Meteor template, I have a function called ohlcInit() that is autorun when new data is available in Mongo: Template.Live.rendered = function(){ function ohlcInit() { // computations run here } Tracker.autorun(function() { …
Jon Cursi
  • 3,301
  • 4
  • 27
  • 53
9
votes
2 answers

Meteor.autorun vs Tracker.autorun?

What is the difference between Meteor.autorun and Tracker.autorun? are they just aliases? is one deprecated? is there any instance where one is preferable to the other? I'm well aware of the difference in using this.autorun in template lifecycle…
bigmadwolf
  • 3,419
  • 3
  • 30
  • 44
3
votes
2 answers

Meteor and withTracker: why is a component rendered twice?

I have created a bare-bones Meteor app, using React. It uses the three files shown below (and no others) in a folder called client. In the Console, the App prints out: withTracker rendering withTracker rendering props {} {} state null null In…
James Newton
  • 6,623
  • 8
  • 49
  • 113
3
votes
1 answer

How to check what caused Tracker.autorun fire in Meteor?

During loading my Meteor app my Tracker.autorun function fires too many times. I'd like to inspect what causes that problem, but I cannot even check inside the function what event caused its actual fire. How can I do this? edit: If I do…
Karol Selak
  • 4,248
  • 6
  • 35
  • 65
3
votes
3 answers

Can I specify what session variables a Tracker.autorun() function depends on?

I currently have a piece of code similar to this: Tracker.autorun(function() { var foo = Session.get("foo") var bar = Session.get("bar") if (bar) console.log("foo changed and bar is set") else console.log("foo changed and…
leinaD_natipaC
  • 4,299
  • 5
  • 21
  • 40
2
votes
1 answer

Tracker.autorun not working inside componentDidMount of react

Tracker.autorun not working inside componentDidMount of react when I specify the projection (fields) for output. But the same works when I dont have any projection on mongo query. This works: Meteor.subscribe('quotes'); this.quotesTracker =…
Nikicatz
  • 105
  • 2
  • 11
2
votes
0 answers

How to wait for Tracker before starting a new test?

I have a meteor app and I try to write the following tests: if (Meteor.isClient) { describe('System', () => { describe('check that the system is not active', () => { it('DB table is updated', () => { …
alexarsh
  • 5,123
  • 12
  • 42
  • 51
2
votes
1 answer

How to wait computation in meteor.helper until re-computation due to dependency change in template.autorun has been made?

I always getting this error when reactive variable change: Exception in template helper: Error: $in needs an array at Error (native) at Object.ELEMENT_OPERATORS.$in.compileElementSelector…
user4804299
2
votes
1 answer

What is the relationship between a Blaze View and Template?

I understand that Blaze is used to make a template reactive by utilizing Tracker. I know that a template contains many View objects, one of each template element. Views are the 'building blocks of reactive templates' and 'represents a reactive…
dayuloli
  • 16,205
  • 16
  • 71
  • 126
1
vote
1 answer

Providing a source of reactive data

Context: My current Meteor-React project is a teaching app where a teacher can observe remotely what the learner is doing. There are many different views that the learner can use, so I need to separate the data-sharing aspect from the views…
James Newton
  • 6,623
  • 8
  • 49
  • 113
1
vote
1 answer

Why findOne() doesn't work in withTracker() section but it does work in render() method?

Meteor and React. I am trying to subscribe two collections of mongo, and use a particular document to pass it to a component. If I try to get the document in the whitTracker () section it seems that it will search for it before synchronizing the…
TOTΣM
  • 47
  • 1
  • 7
1
vote
2 answers

How do I call a function only when a React property changes?

I wish to show a modal dialog box (such as an alert()) every time a Meteor subscription, tracked in React with withTracker, changes. I have tried using Tracker.autorun to track changes but cannot work out where in the code to place it. It does not…
Tintin
  • 547
  • 5
  • 17
1
vote
1 answer

Unexpected article=‘undefined’ appears and breaks down my app (Exception from Tracker recompute function:)

I am working on arabic-russian dictionary, editable by users. And I faced an Issue, that I don't understand. I'm using blaze. And there is idea of structure:
Rustam Apay
  • 551
  • 1
  • 4
  • 18
1
vote
1 answer

How to apply Tracker.autorun? Meteor.userId() undefined right after refreshing page

I have a restricted page using Meteor.userId() and roles: class AdminPage extends Component { render() { return (
{ Roles.userIsInRole(Meteor.userId(), 'admin') ? ( }/> …
1
vote
0 answers

Akryum: Vuex@1 for Meteor example app, addTrackers?

I don't really understand any of this from https://github.com/Akryum/meteor-vuex-example/tree/master/imports/vuex/modules: from init(data) all the way to if data in getters at the bottom references to vue instance data or state of…
janat08
  • 1,725
  • 2
  • 16
  • 27
1
2 3 4