2.0.0 • Published 3 years ago

mst-log v2.0.0

Weekly downloads
202
License
MIT
Repository
github
Last release
3 years ago

MST Log

A console logging middleware for MobX State Tree

Install

yarn add mst-log

Usage

import { addMiddleware, types } from "mobx-state-tree";
import { mstLog } from "mst-log";

// Create your store
const myStore = types.model({}).create({});

// Attach the middleware
addMiddleware(myStore, mstLog());

Options

There are a few options you can provide to control how logging works:

type Options = {
  getCallTypeColor: (type: IMiddlewareEventType) => string;
  getShouldGroupBeCollapsed: (call: IMiddlewareEvent) => boolean;
  logger: Logger;
  getTime: () => number;
};

If theres some aspect you would like to be able to change please do open a PR :)

Thanks

Thanks go to the redux-logger library for the inspiration in this one.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

2.0.0

3 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago