Working with state
; // create the store where things get persistedconst store = ; // create a repository (one repository can have many tags/branches)let r = store id: 'myrepo' ; // create/fetch a branch and namelet master = r;master = master;master = master; // update the 'master' tag to point to this statemaster = master; // fetch new metadata into rr = r; // checkout another copy of the master branchlet wip = r;wip === master; // => true // change wip and commit to masterwip = wip;wip = wip; // continue working on master// and now try to commitmaster = master;master = master; // fail 'needs rebase' since upstream is ahead // fix it by pulling latestmaster = master; // or fix it by rebasing from wipmaster = master; // now can commitmaster;
Building a graph (low level)
// create a node to represent a "Person" typemaster = master; // create a property to hold the person's namemaster = master; // create an "instance" of a person nodemaster = master; // store a namemaster = master;master = master;
Build a graph (high level) - DEPRECATED
// create a node to represent a "Person" typemaster = master; // create an "instance" of a person nodemaster = master;
Querying the graph
let result;result mastelr = master; // => {data: { node: { name: 'jeff' } } }