drator
v0.1.8
Published
Simple Hydration API for sending data between the server and the client
Downloads
26
Readme
Drator
Simple API for sending data from the server to the client mainly so I can get used to publishing to npm.
Usage
// server.js
import {dehydrate} from 'drator';
const data = {
simple: 'object'
}
const markup = dehydrate('App', data);
// 'window.App={"simple":"object"}'
// client.js
import {hydrate} from 'drator';
const data = hydrate('App');
data.simple; // 'object'