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

stimulus-store

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stimulus-store

Lightweight state management for Stimulus.js

latest
Source
npmnpm
Version
0.0.3
Version published
Weekly downloads
2.8K
-5.19%
Maintainers
0
Weekly downloads
 
Created
Source
Stimulus Store Logo

Stimulus Store Logo

GitHub package.json version GitHub Actions Netlify Status Last Commit Commit Activity All Contributors Pull Requests Closed Pull Requests GitHub issues PRs Welcome GitHub stars GitHub forks GitHub watchers Type Definitions BiomeJS Maintainability Test Coverage npm version npm downloads Bundle Size Bundle Min Tree-shaking size Top Language GitHub code size in bytes Maintenance Dependabot Made with Love


Ultra lightweight state management for your Stimulus powered web applications.


  • Create and manage global state with ease. 🔄
  • Share state between different controllers effortlessly using a unified, atomic Store class. 🔀
  • 1.04KB Minified and Brotlied 🪶

Installation

With a build system

Install with npm:

npm install stimulus-store

Install with yarn:

yarn add stimulus-store

UMD

If you prefer not to use a build system, you can load stimulus-store in a <script> tag and it will be globally available through the window.StimulusStore object.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <script src="https://unpkg.com/stimulus/dist/stimulus.umd.js"></script>
    <script src="https://unpkg.com/stimulus-store/dist/bundle.umd.js"></script>
    <script>
      (() => {
        const application = Stimulus.Application.start();

        const helloStore = StimulusStore.createStore({
          name: "myStore",
          type: String,
          initialValue: "Hello World!",
        });

        application.register(
          "hello",
          class extends Stimulus.Controller {
            static stores = [helloStore];

            connect() {
              StimulusStore.useStore(this);
              this.element.innerHtml = `<p>${this.helloStoreValue}</p>`;
            }
          }
        );
      })();
    </script>
  </head>
  <body>
    <div data-controller="hello"></div>
  </body>
</html>

Documentation

complete documentation on Stimulus Store, including guides, API details, and more can be found on www.stimulus-store.com.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Tomas Caraccia
Tomas Caraccia

💻 ⚠️ 📖 🚧 👀 💬
Omar Luq
Omar Luq

💻 ⚠️ 📖 🚧 👀 💬
Add your contributions

This project follows the all-contributors specification. Contributions of any kind welcome!


License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Keywords

stimulus

FAQs

Package last updated on 05 Jul 2024

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