ivantsov / Redux Subscriber
Subscribe to changes in any part of redux state
Stars: ✭ 205
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to Redux Subscriber
Apple Device Model List
All Apple devices model name list. 通过内部编号判断 iOS 设备型号。
Stars: ✭ 149 (-27.32%)
Mutual labels: watch
General Store
Simple, flexible store implementation for Flux. #hubspot-open-source
Stars: ✭ 171 (-16.59%)
Mutual labels: store
Hitrava
Convert your Huawei Health sport activities and import them in Strava.
Stars: ✭ 156 (-23.9%)
Mutual labels: watch
Symfony Vuejs
Source code of the tutorial "Building a single-page application with Symfony 4 and Vue.js"
Stars: ✭ 170 (-17.07%)
Mutual labels: store
Fluttergames
Flutter app for purchasing and renting games.
Stars: ✭ 182 (-11.22%)
Mutual labels: store
Spree
Open Source headless multi-language/multi-currency/multi-store eCommerce platform
Stars: ✭ 11,571 (+5544.39%)
Mutual labels: store
Inapppurchase
A Simple and Lightweight framework for In App Purchase
Stars: ✭ 202 (-1.46%)
Mutual labels: store
Fastkv
FastKV is a real-time and high-performance persistent key-value store implemented by mmap. FastKV是由mmap实现的一个高实时性、高性能key-value持久化存储组件。
Stars: ✭ 163 (-20.49%)
Mutual labels: store
Uploadcare Widget
Uploadcare Widget, an ultimate tool for HTML5 file upload supporting multiple file upload, drag&drop, validation by file size/file extension/MIME file type, progress bar for file uploads, image preview.
Stars: ✭ 183 (-10.73%)
Mutual labels: store
My Ttgo Watch
Firmware for a ttgo-watch2020-v1 smartwatch based on ESP32 from LilyGo.
Stars: ✭ 192 (-6.34%)
Mutual labels: watch
Store
A beautifully-simple framework-agnostic modern state management library.
Stars: ✭ 204 (-0.49%)
Mutual labels: store
Newpipe
A libre lightweight streaming front-end for Android.
Stars: ✭ 15,786 (+7600.49%)
Mutual labels: watch
redux-subscriber
This package allows you to subscribe to changes in any part of Redux state.
Installation
npm install redux-subscriber --save
Usage
store.js
import {createStore} from 'redux';
import initSubscriber from 'redux-subscriber';
const store = createStore(...);
// "initSubscriber" returns "subscribe" function, so you can use it
const subscribe = initSubscriber(store);
somewhere-else.js
// or you can just import "subscribe" function from the package
import {subscribe} from 'redux-subscriber';
const unsubscribe = subscribe('user.messages.count', state => {
// do something
});
// if you want to stop listening to changes
unsubscribe();
Examples
-
https://github.com/ivantsov/yandex-mail-notifier-chrome - real app that uses
redux-subscriber
API
initSubscriber(store)
(default export) - initialize redux-subscriber
, so after that you can use subscribe
method.
Options
-
store
- instance of Redux store.
Returns subscribe
function.
subscribe(key, callbackFunction)
- subscribe callbackFunction
to changes.
Options
-
key
- string which specified the part of state (e.g.user.message.count
) to listen to. -
callbackFunction
- function which will be called when the part of state has changed. New state is passed as a parameter.
Returns unsubscribe
function which can be called to unsubscribe from changes.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].