Fetcher icon indicating copy to clipboard operation
Fetcher copied to clipboard

Easily retrieve, store and refresh Method results

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.

// 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