Skip to content

gwendall/meteor-ground-user

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

- NOTE: This package is not maintained anymore.
- If you want to help, please reach out to gwendall.esnault@gmail.com

Meteor Ground User

Get logged user's data available on startup and offline.

Installation

meteor add gwendall:ground-user

What it is for

tl;dr - Performance is a Feature
Extended explanation: by default, Meteor fetches your logged users' basic information on startup: username, emails, profile (see docs).
Should you need to get additional fields, you can subscribe to a publication (A) with those fields. However, on each page refresh, Meteor will fetch the user document with its basic information (as described above) and replace it in the Meteor.users collection. As a result, those additional fields will not be available until your subscription (A) is ready again. Which is a bummer.
This package ensures you get this data available right away on startup by keeping it in localStorage, and wipes it out on logout.

Notes

  • This package will make Meteor.user() be a document of the GroundUser collection (only storing the currently logged user).
    Should you need to attach helpers (from dburles:collection-helpers), hooks (from matb33:collection-hooks), or any other method to your Meteor.users collection, also do it on the GroundUser object.

About

Get logged user's data available on startup and offline.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published