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

@erickmerchant/combine-stores

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

@erickmerchant/combine-stores

A module to create a store from other stores where each is responsible for one property in the state.

  • 3.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@erickmerchant/combine-stores

Meant to be used with @erickmerchant/framework, it can be used to construct a store that's easy to organize. It defines a state that is an object and each store that you define handles a single property on that object.

/* an example */

const framework = require('@erickmerchant/framework')

/* here is the relevant stuff */

const container = require('@erickmerchant/combine-stores')

const store = container(function (define) {
  define('errors', require('./stores/errors'))
  define('fetchingCount', require('./stores/fetching-count'))
  define('tasks', require('./stores/tasks'))
})

/* end relevant */

const component = require('./component.js')

const target = document.querySelector('main')

const yo = require('yo-yo')
const diff = yo.update

framework({target, store, component, diff})

API Reference

container

container((define) => { ... })

The function exported by this module.

  • define

define

define(property, store)

  • property: the property that the store will handle
  • store: a store. When it is called it is only passed the property that it handles as the first argument. When called with no arguments it should return the default for that property.

FAQs

Package last updated on 24 Oct 2017

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