Skip to content

deanrad/deanius-at-at

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

At-At

Through the blowing snow of Meteor APIs, a 4 legged figure appeared.

It was an Imperial At-At

image

And the APIs it wielded were a powerful force indeed.

// Runs the function passed on the server
// conceptually: if(Meteor.isServer){ fn.call() }
Meteor.atServer(fn)

// Runs the function passed on the client
// (Meteor.isClient || Meteor.isCordova) && !Meteor.isServer
Meteor.atClient(fn)

// Meteor.isClient && !Meteor.isCordova
Meteor.atBrowser(fn)

// Meteor.isClient && Meteor.isCordova
Meteor.atCordova(fn)

// alias for Meteor.atCordova
Meteor.atDevice(fn)

Ideas

  • Meteor.atBrowser( _.once(fn) ) - run a function in the browser only once
  • Meteor.atServer( _.throttle(fn, 1000) ) - run a function on the server no more than once per second
  • Meteor.atServer( _.defer(fn) ) - run a function once the call-stack has cleared a la setTimeout(fn, 0)
  • Any function on the Underscore doc site could be used, the key point being that by taking functions, your flexibility of use is improved.

About

Helpers for Meteor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published