samkhan27 / lwc-redux Goto Github PK
View Code? Open in Web Editor NEWLightning Web Components (LWC) bindings for Redux
License: MIT License
Lightning Web Components (LWC) bindings for Redux
License: MIT License
Cool project, I'm currently using this for a prototype!
Localstorage can be added by :
import { DEFAULT_STORE_NAME, DEFAULT_LOCALSTORAGE_NAME } from 'c/constants'
@api localstorgeName = DEFAULT_LOCALSTORAGE_NAME;
@api persistedState = localStorage.getItem(DEFAULT_LOCALSTORAGE_NAME)
? JSON.parse(localStorage.getItem(DEFAULT_LOCALSTORAGE_NAME))
: {};
async connectedCallback() {
const {
storeName,
reducers,
persistedState,
useCombineReducers,
useThunk,
useLogger,
secondary,
} = this;
const store = createStore(rootReducer, persistedState, enhancer);
store.subscribe(()=>{
localStorage.setItem('reduxState', JSON.stringify(store.getState()));
});
Although it works, there is this strange issue that localStorage stores the redux state with key '1' intead of the defined DEFAULT_LOCALSTORAGE_NAME.
Any idea why is that?
Hi @samkhan27 , It's very nice to see this awesome State management container in LWC. I started exploring the Redux and started integrating it into our app.
I tried to integrate the redux store with the redux devtools chrome plugin for better debugging. But calling the window.REDUX_DEVTOOLS_EXTENSION_COMPOSE is giving me undefined.
Here is the article.
https://github.com/zalmoxisus/redux-devtools-extension
Please suggest the usage techniques for devtools.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.