https://github.com/gwendall/meteor-ground-user
Get logged user's data available on startup and offline.
https://github.com/gwendall/meteor-ground-user
Last synced: about 2 months ago
JSON representation
Get logged user's data available on startup and offline.
- Host: GitHub
- URL: https://github.com/gwendall/meteor-ground-user
- Owner: gwendall
- Created: 2015-03-27T12:58:05.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2017-08-07T14:18:39.000Z (almost 8 years ago)
- Last Synced: 2025-04-04T22:46:58.842Z (about 2 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 3
- Watchers: 3
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
```diff
- NOTE: This package is not maintained anymore.
- If you want to help, please reach out to [email protected]
```Meteor Ground User
================Get logged user's data available on startup and offline.
Installation
------------``` sh
meteor add gwendall:ground-user
```What it is for
--------------tl;dr - [Performance is a Feature](http://blog.codinghorror.com/performance-is-a-feature/)
Extended explanation: by default, Meteor fetches your logged users' basic information on startup: username, emails, profile ([see docs](http://docs.meteor.com/#/full/meteor_users)).
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.