Skip to content

Guard your react app against unlogged in users and on-going subscriptions

Notifications You must be signed in to change notification settings

poetic/meteor-react-guard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Example

import { GuardUser, GuardSubscriptions } from 'meteor/poetic:meteor-react-guard';

Meteor.startup(() => {
  const getSubscriptions = () => ([
    Meteor.subscribe('domains'),
    Meteor.subscribe('subDomains'),
    Meteor.subscribe('workflows'),
  ]);

  const guardedApp = (
    <GuardUser
      loadingElement={<h1>Trying to log in</h1>}
      loginElement={<h1>This is the login form</h1>}
    >
      <GuardSubscriptions
        getSubscriptions={getSubscriptions}
        loadingElement={<h1>Subscriptions are not ready</h1>}
      >
        <h1>Subscriptions are ready</h1>
      </GuardSubscriptions>
    </GuardUser>
  )

  render(guardedApp, document.getElementById('render-target'));
});

About

Guard your react app against unlogged in users and on-going subscriptions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published