meteorhacks/inject-data

Name: inject-data

Owner: meteorhacks

Description: A way to inject data to the client with initial HTML

Created: 2015-01-21 12:01:14.0

Updated: 2017-09-03 12:34:33.0

Pushed: 2016-12-12 14:04:28.0

Homepage: null

Size: 17

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

meteorhacks:inject-data

A way to inject data to the client with initial HTML

This is the package used by fast-render to push data to the client with the initial HTML.

Installation

meteor add meteorhacks:inject-data

Push Data

We need to use this package with a server side router. We've extended nodejs http.OutgoingMessage and provides an API like this.

Here is an example with picker.

er.route("/", function(params, req, res, next) {
r ejsonData = {aa: 10};
jectData.pushData(res, "some-key", ejsonData);
 make sure to move the routing forward.
xt();

Get Data

You can get data with the following API from the client.

ctData.getData("some-key", function(data) {
nsole.log(data);


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.