Git Product home page Git Product logo

Comments (5)

Frenzie avatar Frenzie commented on May 29, 2024

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.

paulrouget avatar paulrouget commented on May 29, 2024

Afaict todos.x does work? Both with store() from v12.x and signal() 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.

Frenzie avatar Frenzie commented on May 29, 2024

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.

cferdinandi avatar cferdinandi commented on May 29, 2024

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.

cferdinandi avatar cferdinandi commented on May 29, 2024

Fixed the docs!

from reef.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.