https://github.com/msavin/fetcher
Easily retrieve, store and refresh Method results
https://github.com/msavin/fetcher
Last synced: 9 months ago
JSON representation
Easily retrieve, store and refresh Method results
- Host: GitHub
- URL: https://github.com/msavin/fetcher
- Owner: msavin
- License: mit
- Created: 2015-05-19T00:21:35.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-05-29T00:52:27.000Z (over 10 years ago)
- Last Synced: 2025-03-25T11:11:26.525Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 223 KB
- Stars: 26
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Fetcher
Fetcher is designed to make retrieve and store Method results easy. It will run Meteor.call() for you, then deposit the result into a reactive dictionary. Just like a Session variable, you can use that data anywhere in your application, and it persists through hot reloads.
# How to Use
Fetcher relies on Meteor.call() to retrieve data from Methods, and Reactive-Dict to return reactive data to Blaze or wherever you may need it.
```javascript
// get data from server
// params are for the Method call
Fetcher.retrieve("taco", "methodName", param1, param2, param3, etc)
// return data
Fetcher.get("taco")
// modify the data
Fetcher.set("taco", {'cheese' : 'yes please'})
// re-run previous Fetcher.retrieve()
Fetcher.refresh("taco")
```
# Advertisment
Check out Meteor Toys, the insanely handy development tools for Meteor!
Licensed under MIT