{"id":15284206,"url":"https://github.com/nlhuykhang/reactive-var-std","last_synced_at":"2025-04-12T23:21:20.805Z","repository":{"id":57348245,"uuid":"75742673","full_name":"nlhuykhang/reactive-var-std","owner":"nlhuykhang","description":"Standalone Reactive Var From Meteor","archived":false,"fork":false,"pushed_at":"2016-12-26T05:55:08.000Z","size":264,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T00:51:59.465Z","etag":null,"topics":["meteor","standalone"],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nlhuykhang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-06T15:08:55.000Z","updated_at":"2017-10-26T12:38:56.000Z","dependencies_parsed_at":"2022-08-31T16:44:56.593Z","dependency_job_id":null,"html_url":"https://github.com/nlhuykhang/reactive-var-std","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlhuykhang%2Freactive-var-std","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlhuykhang%2Freactive-var-std/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlhuykhang%2Freactive-var-std/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlhuykhang%2Freactive-var-std/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nlhuykhang","download_url":"https://codeload.github.com/nlhuykhang/reactive-var-std/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248644179,"owners_count":21138563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["meteor","standalone"],"created_at":"2024-09-30T14:51:18.480Z","updated_at":"2025-04-12T23:21:20.786Z","avatar_url":"https://github.com/nlhuykhang.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Standalone Reactive Var\n\n[![CircleCI](https://circleci.com/gh/nlhuykhang/reactive-var-std/tree/master.svg?style=shield)](https://circleci.com/gh/nlhuykhang/reactive-var-std/tree/master) [![Coverage Status](https://coveralls.io/repos/github/nlhuykhang/reactive-var-std/badge.svg?branch=master)](https://coveralls.io/github/nlhuykhang/reactive-var-std?branch=master) [![npm version](https://badge.fury.io/js/reactive-var-std.svg)](https://badge.fury.io/js/reactive-var-std) [![dependencies](https://david-dm.org/nlhuykhang/reactive-var-std/status.svg)](https://david-dm.org/nlhuykhang/reactive-var-std?view=list) [![Known Vulnerabilities](https://snyk.io/test/github/nlhuykhang/reactive-var-std/badge.svg)](https://snyk.io/test/github/nlhuykhang/reactive-var-std)\n\nA Standalone version of ReactiveVar package from Meteor. Lets you write reactive code with ease outside of Meteor\n\n[Check out the demo here](https://nlhuykhang.github.io/reactive-var-std/)\n\n## Install\n\n##### NPM\n```bash\nnpm install --save reactive-var-std\n```\n\n##### CDN\n```html\n\u003cscript src=\"//cdn.jsdelivr.net/reactive-var-std/1.1.4/reactive-var-std.min.js\"\u003e\u003c/script\u003e\n\u003c!-- OR  --\u003e\n\u003cscript src=\"//cdn.jsdelivr.net/reactive-var-std/latest/reactive-var-std.min.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\n##### ES6\n\n```javascript\nimport StdReactiveVar, { Tracker } from 'reactive-var-std';\n\n// or if you do not use ES6\n// var StdReactiveVar = require('reactive-var-std');\n// var Tracker = StdReactiveVar.Tracker;\n// var StdReactiveVar = StdReactiveVar.default;\n\n// create a creative var instance\nconst reactive = new StdReactiveVar(0);\n\n// wrap the reactive instance inside a computation block created by Tracker.autorun\nTracker.autorun(() =\u003e {\n  // log the value whenever it changes\n  console.log(reactive.get());\n});\n\n// change the value 1st time\nreactive.set(1);\n// ---\u003e the console will show: 1\n\n// change the value 1st time\nreactive.set(10);\n// ---\u003e the console will show: 10\n```\n\n##### ES5\n\n```javascript\nvar StdReactiveVar = require('reactive-var-std');\nvar Tracker = StdReactiveVar.Tracker;\nvar StdReactiveVar = StdReactiveVar.default;\n\n// create a creative var instance\nvar reactive = new StdReactiveVar(0);\n\n// wrap the reactive instance inside a computation block created by Tracker.autorun\nTracker.autorun(function() {\n  // log the value whenever it changes\n  console.log(reactive.get());\n});\n\n// change the value 1st time\nreactive.set(1);\n// ---\u003e the console will show: 1\n\n// change the value 1st time\nreactive.set(10);\n// ---\u003e the console will show: 10\n```\n\n## API\n\n### StdReactiveVar(v:Any)\n\n### .get()\n\n### .set(v:Any)\n\n### .getOld()\n\n### .getNonReactive()\n\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlhuykhang%2Freactive-var-std","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnlhuykhang%2Freactive-var-std","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlhuykhang%2Freactive-var-std/lists"}