How to add calculated getter in a existing store?
const [store, setStore] = createStore({firstName: "Foo", lastName: "Bar"})
11 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Sorry on mobile
@._rb I want to set it after store is created.
@ofabram This is not working.
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
this isn't reactive though
you probably can't do this, if the properties you want to set aren't top level you can but you'd have to replace the entire object
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
but that's not really a getter
anyway it turns out the copy
produce
gives you works with defineProperty
so this works https://playground.solidjs.com/anonymous/c7b438d5-42e6-464d-aa01-73dd755423e1Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
or more completely this https://playground.solidjs.com/anonymous/dc12e29c-e4ff-42de-86f9-fdee4d5a4db7
Solid Playground
Quickly discover what the solid compiler will generate from your JSX template
Oh nice, good to know
@otonashi9 Thanks