New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jlndk/observable-list

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jlndk/observable-list

Lightweight, powerful & framework-agnostic JavaScript state management in less than 1.5KB!

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ObservableList

Lightweight, powerful & framework-agnostic JavaScript state management in less than 1.5KB!

ObservableList is a simple, but flexible way of storing data in Single Page Applications, based on the paradigm of stores, presented by Svelte. The goal is to make it as simple to work with arrays as with primitive data-types, such as integers, booleans and strings, while still offering reactivity, persistance and sharability between application components.

Also includes helper for syncronising data with LocalStorage.

Demo

@TODO

Installing

The package can be installed with NPM or Yarn.

Yarn

yarn add @jlndk/ObservableList

NPM

npm install @jlndk/ObservableList

Usage

See Wiki.

TL;DR:

import {list} from '@jlndk/observable-list';
const list = list(); // or list(["initial", "values"]);
const unsubscribe = list.subscribe(updatedList => {
    //Do what you want with updated list...
    console.log(updatedList[0]); //new value
});
list.push("new value");

Notice: Make sure to call the unsubscribe method when your component is destroyed to prevent memory leaks.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

Tests

@TODO

FAQs

Package last updated on 05 Jun 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc