Comments (2)
I think I'm running in to two separate issues here:
- The "Cannot redefine property" error comes from the fact that ReactiveElement.connect now calls
Object.defineProperty
, which means one should not attempt to define the property with normal field declaration syntax in the class body.
(I think it's also worth mentioning that the key
used to retrieve the thing from the store is always used to define the name of the property on the Element.)
- The store is somehow not updating? debug mode does send a
cami:state:change
message to the console with the correct newValue, but thestore.state
retains the old value.
from cami.js.
Hi @keturn! Thanks for calling this out.
My mistake on that one -- you essentially looked at outdated documentation (for some reason, I updated everything except the store docs).
I've updated the relevant sections in the site, and sharing the updated jsfiddle link below:
- JS Fiddle Link: jsfiddle cart example
- API: store
One thing that you may have noticed is that if you're familiar with other store implementations, it's now less like zustand and more similar to a mix of express/redux. I just found that in the production application that I'm working on, it's a lot more manageable with this new API.
In general, my folder structure looks like this:
elements/
├── elementName1
├── elementName2
└── etc
index.js (this contains all the actions or .register calls)
store.js
I plan to write more about the architecture about non-trivial applications once I launch the production app that uses Cami (by June 2024)
from cami.js.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cami.js.