Comments (5)
Afaict todos.x
does work? Both with store()
from v12.x and signal()
from v13.0.0.
Also, the codepen is outdated and use the old version API.
Looks like it's using signal()
to me, unless it was just changed. ;-)
from reef.
Afaict
todos.x
does work? Both withstore()
from v12.x andsignal()
from v13.0.0.
Ah, I must do something wrong:
let {store} = reef;
let todos = store({ x: 42 }, {})
console.log(todos.value.x); // 42
console.log(todos.x); // undefined
Also, the codepen is outdated and use the old version API.
Looks like it's using
signal()
to me, unless it was just changed. ;-)
From https://reefjs.com/advanced/#stores:
Isn't that outdated: Try store action functions on CodePen → ?
from reef.
Ah, I must do something wrong:
Maybe you're using a really ancient version? Double check if your wires are plugged in. ;-)
Or alternatively, maybe that's not actually the full testcase?
Isn't that outdated
Yes, I was talking about https://codepen.io/cferdinandi/pen/wvmoPMg
from reef.
Good catch! This is an oversight in the docs.
For data store()
objects, the data you get back is immutable and has to be accessed on the value
property. This ensures that the action methods don't collide with the data and provides a way to ensure the data can't be overwritten directly.
I'll update the docs to properly document this.
from reef.
Fixed the docs!
from reef.
Related Issues (20)
- Working with Events Questions HOT 2
- Lifecycle Events - reef:render is fired on all components in the document HOT 2
- Can I use Reef to generate the HTML for a given route? HOT 1
- Updating Multiple Properties at Once HOT 10
- Lack of event support in component HOT 2
- Uncaught TypeError HOT 2
- License? HOT 2
- Add support for on* events that does so safely HOT 2
- 12.3 has broken my app HOT 2
- support disabled and readonly attributes with @ syntax? HOT 5
- jsdoc issue HOT 2
- Listeners remove html attributes HOT 4
- Event functions with parameters HOT 3
- Rename store(), setters() to align with industry norms (breaking change) HOT 1
- Add a way to ignore certain elements when diffing the DOM HOT 1
- Add getter methods to store() object
- tbody element not supported as a component root HOT 3
- Add option to keep attributes on nodes with [reef-keep] HOT 9
- onclick attribute removed by reef HOT 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 reef.