rethinkdb / horizon-docs

Other
24 stars 36 forks source link

Docs tell people to write `require('horizon')` instead of to load `horizon/horizon.js` #93

Closed mlucy closed 8 years ago

mlucy commented 8 years ago

The docs for how to connect to a Horizon server (e.g. on http://horizon.io/api/collection/) tell people to write const Horizon = require("horizon"). This has a few problems:

The docs should probably instead tell people that they need to put <script src="/horizon/horizon.js"></script> somewhere above where they use Horizon.

chipotle commented 8 years ago

In this context -- the JS code -- shouldn't it just become:

const Horizon = new Horizon();

This matches the (brand new) Getting Started example. The <script> tag probably doesn't belong in the API docs; by the time you get there, Horizon is already loaded, one way or another.

mlucy commented 8 years ago

Cool, that sounds good then.

mlucy commented 8 years ago

(Although it should probably be const hz = Horizon() instead of const Horizon = Horizon(), at least the way the page is written now.)