lore-hook-auth

Provides an action and reducer dedicated to fetching the current user

Installation

First install the hook:

npm install lore-hook-auth --save

Then add the hook to your index.js file.

Because this hook generates a reducer, you also need to modify the dependencies array of the redux hook in order to make sure it runs after this hook, so that the reducer is guaranteed to exist when the Redux store is built.

// index.js
import actions from 'lore-hook-actions';
import auth from 'lore-hook-auth';
import collections from 'lore-hook-collections';
import models from 'lore-hook-models';
import reducers from 'lore-hook-reducers';
import redux from 'lore-hook-redux';

lore.summon({
  hooks: {
    auth,
    actions,
    collections,
    models,
    reducers,
    redux: _.extend(redux, {
      dependencies: ['reducers', 'auth']
    })
  }
});