Skip to content

Commit

Permalink
fix errors in usage examples
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewgoslett committed May 3, 2017
1 parent dfa1db3 commit 646a21d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ var LocalPubSubAdapter = require('@superbalist/js-pubsub').LocalPubSubAdapter;
var eventPubSub = require('@superbalist/js-event-pubsub');
var EventManager = eventPubSub.EventManager;
var SchemaEventMessageTranslator = eventPubSub.translators.SchemaEventMessageTranslator;
var JSONSchemaValidator = eventPubSub.validators.JSONSchemaValidator;
var JSONSchemaEventValidator = eventPubSub.validators.JSONSchemaEventValidator;
var SchemaEvent = eventPubSub.events.SchemaEvent;

// create a new event manager
let adapter = new LocalPubSubAdapter();
let translator = new TopicEventMessageTranslator();
let translator = new SchemaEventMessageTranslator();

let ajv = JSONSchemaValidator.makeDefaultAjv();
let ajv = JSONSchemaEventValidator.makeDefaultAjv();
ajv.addSchema({
$schema: 'http://json-schema.org/draft-04/schema#',
title: 'My Schema',
Expand All @@ -152,7 +152,7 @@ ajv.addSchema({
'user'
]
}, 'schemas://events/user/created/1.0.json');
let validator = new JSONSchemaValidator(ajv);
let validator = new JSONSchemaEventValidator(ajv);

let manager = new EventManager(adapter, translator, validator);

Expand Down
6 changes: 3 additions & 3 deletions examples/SchemaEventExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
var LocalPubSubAdapter = require('@superbalist/js-pubsub').LocalPubSubAdapter;
var EventManager = require('../src/EventManager');
var SchemaEventMessageTranslator = require('../src/translators/SchemaEventMessageTranslator');
var JSONSchemaValidator = require('../src/validators/JSONSchemaEventValidator');
var JSONSchemaEventValidator = require('../src/validators/JSONSchemaEventValidator');
var SchemaEvent = require('../src/events/SchemaEvent');

let adapter = new LocalPubSubAdapter();
let translator = new SchemaEventMessageTranslator();

let ajv = JSONSchemaValidator.makeDefaultAjv();
let ajv = JSONSchemaEventValidator.makeDefaultAjv();
ajv.addSchema({
$schema: 'http://json-schema.org/draft-04/schema#',
title: 'My Schema',
Expand All @@ -27,7 +27,7 @@ ajv.addSchema({
'user'
]
}, 'schemas://events/user/created/1.0.json');
let validator = new JSONSchemaValidator(ajv);
let validator = new JSONSchemaEventValidator(ajv);

let manager = new EventManager(adapter, translator, validator);

Expand Down

0 comments on commit 646a21d

Please sign in to comment.