A mixin to stores collections published by the server into an immutable map.
npm install --save asteroid-immutable-collections-mixin immutable
After cloning the repository, install npm dependencies with npm install.
Run npm test to run unit tests, or npm run dev to have mocha re-run your
tests when source or test files change.
import {createClass} from "asteroid";
import immutableCollectionMixin from "asteroid-immutable-collections-mixin";
const Asteroid = createClass([immutableCollectionMixin]);
const asteroid = new Asteroid({
endpoint: "ws://localhost:3000/websocket"
});
// Somewhere in your code:
import {Map} from "immutable";
// Use real-time collections
asteroid.subscribe("collection-name");
// Collection is an immutable map
const collection = asteroid.collections.get("collection-name") || Map();This method is to use this mixin with the asteroid-oauth-mixin.
providerNamestring required: the provider name with whom you want to login with Oauth.
An object that contains the clientId, the consumerKey or the appId that is used by the asteroid-oauth-mixin.