hyperfact

0.1.0-alpha.7 • Public • Published

Hyperfact

Store data as a unified JSON-LD graph.

This experimental. Expect things to change.

Quick start

import createStore from "hyperfact";
 
const facts = createStore();
 
// add facts to the store (this is async!)
facts.merge({
              "@context": "http://schema.org/",
              "@id": "https://people.example/profile/jane#me",
              "@type": "Person",
              "name": "Jane Doe",
              "jobTitle": "Professor",
            });
            
// subscribe to changes
facts.subscribe('https://people.example/profile/jane#me', (current, prev) => {
  console.log('updated', {current, prev});
});
 
// get facts
const data = facts.getResource('https://people.example/profile/jane#me');
console.log()

Package Sidebar

Install

npm i hyperfact

Weekly Downloads

0

Version

0.1.0-alpha.7

License

MIT

Unpacked Size

12.4 kB

Total Files

5

Last publish

Collaborators

  • aveltens