@front.build/supergraph

1.0.0 • Public • Published






▼ Supergraph







A typed key/value store built
in JavaScript for the frontend.



UsageWhy?PrinciplesExamplesDocumentation



Supergraph aims to solve the problem of managing data on the frontend.


Usage

var graph = new Supergraph()
graph.field('Comment/children[]', { type: 'Comment' })
graph.field('Comment/message', { type: 'String' })
graph.field('User/email', { type: 'String' })
graph.field('User/profile/backgroundColor', { type: 'String' })
graph.field('User/comments[]', { type: 'Comment' })

graph.on('diff', function(){

})

graph.set('User/1/email')
graph.get('User/1/email')

var query = graph.query()
query.given('User/email', 'matches', 'foo')

Why?

Because when you modify data on the frontend, you often change it from multiple different angles and it is hard to keep in sync.

This can be used to persist the client state to the database.


Principles


Examples


Documentation

Readme

Keywords

none

Package Sidebar

Install

npm i @front.build/supergraph

Weekly Downloads

1

Version

1.0.0

License

none

Last publish

Collaborators

  • lancejpollard