New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

my-little-store

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

my-little-store

Light-weight and simple store library

latest
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

Description

A simple and fast store to use as truth source and update your reactive components.

Fertures

  • Fast
  • Minimalistic
  • Simple to use
  • Can be used to create your own store
  • No proxies inside!
  • No reducers, dispatchers or other nonsence

Instalation

npm i my-little-store -S
yarn add my-little-store

Usage

Constructor

ArgumentsDescription
valuesobject with initial values that will be stored

Methods

NameargumentsDescription
add{prop1: value1[, prop2:value2[, ...[, propN:valueN]]]}adds new prop(s) to store
remove`prop[prop1[, prop2[, ...[, propN]]]]`
update{prop1: value1[, prop2:value2[, ...[, propN:valueN]]]}updates multiple props fom provided object
subscribecallbackwill fire your callback when any prop changes with current values
unsubscribecallbackunsubscribe a callback from store updates
onprop, callbackwill fire your callback on prop updates with value
offprop, callbackunsubscribe from prop updates
oneprop, callbacksubscribe for next change
addMiddlewareprop, callbackadd a middleware function that will be called before the value setter, must return a value
removeMiddlewarepropremoves middleware from prop

Getters

NameReturnsDescription
propsarrayReturns an object with prop:prop pairs
valuesvaluesReturns object containing stored items

Examples

Simple usage

Complete API documentation

API

Development

Install requirements

yarn
npm i

Build

yarn build
npm run build

Test

yarn test
npm test

Generate API documentation

yarn docs
npm run docs

TODO

  • tests

Contibutions

Yes, please!

Also this

Written with ❤❤❤ by Wasteland Fluttershy.

Keywords

store

FAQs

Package last updated on 06 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts