Skip to content

Commit

Permalink
Revamp README
Browse files Browse the repository at this point in the history
  • Loading branch information
kubk committed Nov 10, 2024
1 parent ef9cdf1 commit ac2c078
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
Binary file added .github/browser-log-prev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/main-prev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .github/redux-prev.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed .github/screely.png
Binary file not shown.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)

Logger + Redux devtools for Mobx 6+. Works only in dev mode.
![screenshot](.github/screely.png)
![screenshot](.github/main-prev.png)

### Installation

```
npm i mobx-log
```

There are 3 ways how you can use `mobx-log` in your project:

### Usage with Redux Devtools

1. Make sure [Redux Devtools](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd?hl=en) are installed
Expand All @@ -32,6 +34,9 @@ class SomeStore {
}
```

Result:
![screenshot](.github/redux-prev.png)

### Usage with browser logger

1. Add `makeLoggable` to a store:
Expand All @@ -53,6 +58,9 @@ class SomeStore {

You'll only need to do it once.

Result:
![screenshot](.github/browser-log-prev.png)

3. If you have Redux devtools installed then you need to deactivate it. The `mobx-log` package tries to detect automatically what you'd like to use - browser console or Redux devtools. Installed Redux devtools take precedence over browser console.

### Use only browser formatters
Expand All @@ -67,6 +75,12 @@ applyFormatters();

Make sure this function is called at the very top of your code

> [!IMPORTANT]
> Make sure to enable [custom formatters](#usage-with-browser-logger) before using it
> [!NOTE]
> You don't have to call `applyFormatters` if you are already using [makeLoggable](#usage-with-browser-logger). In this case formatters are applied automatically.
## Customize

### Access stores as global variables in browser console.
Expand Down

0 comments on commit ac2c078

Please sign in to comment.