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

storeon

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storeon - npm Package Compare versions

Comparing version 0.9.2 to 0.9.3

3

CHANGELOG.md
# Change Log
This project adheres to [Semantic Versioning](http://semver.org/).
## 0.9.3
* Improved TypeScript support for typed events and store (by @majo44).
## 0.9.2

@@ -5,0 +8,0 @@ * Fix passing options for Redux DevTools (by Hovhannes Babayan).

19

index.d.ts

@@ -0,6 +1,9 @@

type DataTypes<Map, Key extends keyof Map> =
Map extends never ? [any?] : (Map[Key] extends (never | undefined) ? [never?] : [Map[Key]])
declare namespace createStore {
export type Dispatch<EventsDataTypesMap = any> = <Event extends keyof EventsDataTypesMap>(
event: Event, ...data: (EventsDataTypesMap[Event] extends (never | undefined) ? [never?] : [EventsDataTypesMap[Event]])) => void;
export type Dispatch<EventsDataTypesMap> = (<Event extends keyof EventsDataTypesMap>(
event: Event, ...data: DataTypes<Partial<EventsDataTypesMap>, Event>) => void) & {___events: EventsDataTypesMap};
export interface Store<State = unknown, EventsDataTypesMap extends StoreonEvents<State> = any> {
export interface Store<State = unknown, EventsDataTypesMap = any> {
readonly on: <Event extends keyof EventsDataTypesMap>(

@@ -14,14 +17,14 @@ event: Event,

export type Module<State, EventsDataTypesMap extends StoreonEvents<State> = any> = (store: Store<State, EventsDataTypesMap>) => void;
export type Module<State, EventsDataTypesMap = any> = (store: Store<State, EventsDataTypesMap>) => void;
export interface StoreonEvents<State> {
'@init': never;
'@changed': Partial<State>;
'@changed': State;
}
}
declare function createStore<State, EventsDataTypesMap extends createStore.StoreonEvents<State> = any>(
modules: Array<createStore.Module<State, EventsDataTypesMap> | false>
): createStore.Store<State, EventsDataTypesMap>;
declare function createStore<State, EventsDataTypesMap = any>(
modules: Array<createStore.Module<State, EventsDataTypesMap> | false>
): createStore.Store<State, EventsDataTypesMap & createStore.StoreonEvents<State>>;
export = createStore;
{
"name": "storeon",
"version": "0.9.2",
"version": "0.9.3",
"description": "Tiny (173 bytes) event-based Redux-like state manager for React and Preact",

@@ -17,3 +17,10 @@ "keywords": [

"./devtools/logger.js": "./devtools/logger.browser.js"
},
"eslintIgnore": [
"node_modules",
"test/demo/dist"
],
"sharec": {
"version": "0.3.5"
}
}
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