Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lstate

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lstate

A simple, super-efficient and small (just 2.1kb) global state for React/Typescript applications

  • 1.2.2
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Node.js CI Coverage Status

lstate

A simple, super-efficient and small (just 2.1kb) global state for React/Typescript applications

install

npm install --save lstate

usage


import React from 'react';
import { createLState, useLState } from "lstate";

const sample = createLState({
    initial: {count: 0},
    reducers: (setter) => ({
        inc() {
            setter((old) => ({count: old.count + 1}))
        },
    })
})

export function App() {
  const { count } = useLState(sample)
  return  <div className="App">
    <h1>Testing lstate</h1>
    <h2>A simple, super-efficient and small (just 2.1kb) global state for React/Typescript applications</h2>
    <p>count: {count}</p>
    <button onClick={sample.inc}>+</button>
  </div>
}

Click here to see a running demo

FAQs

Package last updated on 08 Feb 2022

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