1.0.8 • Published 2 years ago

nogimo v1.0.8

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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