timea-solid / SolidPeriodTracker

This is an Open Source Period Tracker in the making that just happens to be using Solid.
12 stars 4 forks source link

Create a store for our data #12

Open YetAnotherJonWilson opened 2 years ago

YetAnotherJonWilson commented 2 years ago

Probably use rdflib. Here's the recommendation from a Gitter chat on this topic:

For global (app wide) data we already have a store, the rdflib store. For local (component) data use state or context. You could put the rdflib store in a context, and then retrieve it in hooks further down in the component tree to query specific data for that component Create the rdflib store on top level, e.g. next to the root react render, the pass the store to a context provider You can also use reacts useReducer in certain places where you want the redux action/reducer style instead of plain data read/write

YetAnotherJonWilson commented 2 years ago

We may be able to use solid-client, as we have really simple data needs, at least for getting started. Probably just an array of objects, where each object contains two items, startDate (https://schema.org/startDate) and endDate (https://schema.org/endDate).