0.1.3 • Published 3 years ago

recoil-logger-lite v0.1.3

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

recoil-logger-lite

License

  • Recoil (logity) print state change information.
  • Demo

main_exam

install

yarn add -D recoil-logger-lite

or

npm install -D recoil-logger-lite

example

index.tsx

import React from "react";
import ReactDOM from 'react';
import { App } from "./App";
import { RecoilRoot } from 'recoil';
import { DebugObserver } from 'recoil-logger-lite';

ReactDOM.render( { process.env.NODE_ENV !== 'production' && ( // print type: (Default) "object" | "string" ) } , document.getElementById("root"));

> src/recoil/atom.ts
```tsx
import { atom } from "recoil";
import { effects_UNSTABLE } from "recoil-logger-lite";

interface IUser {
  id: number;
  username: string;
}

export const countAtom = atom<number>({
  key: "member/home/no",
  default: 0,
  effects_UNSTABLE,
});

export const userAtom = atom<IUser>({
  key: "mypage/user",
  default: {
    id: 0,
    username: "",
  },
  effects_UNSTABLE,
});

screenshot

capture1 exam

0.1.3

3 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.7

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago