FireworksX / graph-state

Cache state manager.
2 stars 1 forks source link

GraphState instance can have its own state #36

Closed FireworksX closed 4 months ago

FireworksX commented 4 months ago

Now Instance can have only other graphs, but Instance is also Graph and he needs have payload.

const instance = createState({
  initialState: {
    value: 100,
    user: {
        _type: 'User',
       _id: 'test'
    }
  }
})

const [reactValue] = useGraph(instance, instance)

/*
reactValue={
    value: 100,
    user: 'User:test'
}
*/