nogimo
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

image info

Installation

To install run the following script from the root of your project's directory:

Using Npm

npm install nogimo 

Useing Yarn

yarn add nogimo 

Nogimo

Description: Rxjs Based State Management toolkit.

Nogimo is a state management pattern, created on top of RxJS, Which maintains simplicity APIs too sync with localstorage.

Example

import { Nogimo } from "nogimo";

const store = new Nogimo(null, "storageKey");
// Get the state
const currentValues = store.getValue();
// Get the observable
const obs = store.get();
// Set the state
store.set({
  name: "John",
  age: 30,
});
// Update the state
store.update((state) => {
  state.name = "John";
  state.age = 30;
  return state;
});
// Patch the state
store.patch({
  name: "John",
  age: 30,
});
// Reset the state
store.reset();
// Clear the state
store.clear();

Dependencies

"rxjs":  "^7.5.5",
"typescript":  "^4.7.4"

Configuration

// 1st Param accept initial Values.
// 2nd Param accept localStorage Key.
const store = new Nogimo(null, "storageKey");

Exmaple

Svelte Example

Credits

@jahir9991

Package Sidebar

Install

npm i nogimo

Weekly Downloads

1

Version

1.0.8

License

ISC

Unpacked Size

77.4 kB

Total Files

27

Last publish

Collaborators

  • jobayerdev