This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

im-sang-tae
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

IM_SANG_TAE - A Global State Management Library

IM_SANG_TAE is a global state management library for JavaScript applications. It's designed to provide a simple and intuitive API for managing state in an efficient and scalable way.

Features

  • Supports both atom and selector for managing state.
  • Easy to integrate with any JavaScript application.
  • Efficient updates and minimal re-renders.
  • Support for tracking dependencies between selectors.

Installation

# using npm
npm install im-sang-tae

# using yarn
yarn add im-sang-tae

Usage

To start using IM_SANG_TAE in your project, you need to create atoms or selectors with an initial state:

import { defaultStore } from "im-sang-tae";

// create atom
const myAtom = defaultStore.createAtom({
  key: "myAtom",
  initialState: 0,
});

// create selector
const mySelector = defaultStore.createAtom({
    key: "mySelector",
    get: ({get}) => {
        return get(myAtom) + 1;
    }
})

You can get the current state and set a new state using the atomState method from the state manager:

import { defaultStateManager } from "im-sang-tae";

const [getMyAtom, setMyAtom] = defaultManager.atomState(myAtom);
const [getMySelector, setMySelector] = defaultManager.atomState(mySelector);

defaultStateManager.subscribe(myAtom, () => {
  console.log(getMyAtom());
});

defaultStateManager.subscribe(mySelector, () => {
  console.log(getMySelector());
});

License

This project is licensed under the MIT License.

Contribute

Contribute.

Package Sidebar

Install

npm i im-sang-tae

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

19.2 kB

Total Files

11

Last publish

Collaborators

  • pho9902
  • skmin