Mimmicking Deps.autorun from Meteor in pure Node
✓ Published0🌍 Public
Aalessioalex
Last edited Jun 20, 2014
Created on Jun 20, 2014
This example demonstrates a pure Node.js implementation of Meteor’s reactive `Deps.autorun` pattern, showing how dependent computations automatically re-run when their data sources change. The code uses Node’s `EventEmitter` to simulate a reactive `Session` object, whose `get` and `set` methods trigger change events. Two `Deps.autorun` callbacks log session values, and a `stop()` method halts one computation after a condition is met. The example runs asynchronous timers to illustrate re-execution and manual invalidation.
AI-generated description