elastic-store-logger

0.1.4 • Public • Published

Introduction

A logger for elastic-store.

Installation

$ npm install --save elastic-store-logger

Usage

It can be attached in two different ways.

While creating a store

import {Store} from "elastic-store";
import {logger} from "elastic-store-logger";
 
let actions = { ... };
 
let aStore = Store(actions, [logger]);

After creating a store

import {Store} from "elastic-store";
import {logger} from "elastic-store-logger";
 
let actions = {
    todos: {
        add () { ... },
        remove () { ... }
    },
    notification: { ... }
};
 
let aStore = Store(actions);
 
// will log changes made by actions at 'todos' node
aStore.attach("todos", logger);
 
// OR
 
// will log changes caused by action at 'todos.add'
aStore.attach("todos.add", logger);

Readme

Keywords

Package Sidebar

Install

npm i elastic-store-logger

Weekly Downloads

41

Version

0.1.4

License

ISC

Last publish

Collaborators

  • ludbek