kuzzleio / sdk-javascript

Kuzzle Javascript SDK. High level library including multi-protocol support, offline resiliency, realtime data and more
http://docs.kuzzle.io/sdk/js/7
Apache License 2.0
39 stars 15 forks source link

kuzzle.dataCollectionFactory is not a function #8

Closed killerwolf closed 8 years ago

killerwolf commented 8 years ago
        <script src="https://rawgit.com/kuzzleio/sdk-javascript/browser/kuzzle.min.js"></script>
        <script>
            var kuzzle = Kuzzle('http://192.168.99.100:7512');
            var collection = kuzzle.dataCollectionFactory('myCollection');
        </script>
Uncaught TypeError: kuzzle.dataCollectionFactory is not a function
benoitvidis commented 8 years ago

The current implementation requires to use the new keyword to get a kuzzle instance.

var kuzzle = new Kuzzle('http://192.168.99.100:7512');

We will update the constructor to return a valid instance even if called without the new keyword. In the meantime, adding it should do the trick.

killerwolf commented 8 years ago

fixed..forgot to add new when moving away from Kuzzle.init