How to use the postal.reset function in postal

To help you get started, we’ve selected a few postal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github storyteller / Storyteller / client / component-tests / old / test-expiration-period.jsx View on Github external
beforeEach(() => {
    Postal.reset();
    listener.clear();

    Postal.subscribe({
        channel  : "editor",
        topic    : "*",
        callback : function(data, envelope) {
          data.topic = envelope.topic;
            listener.append(data);
        }
    });

    Postal.subscribe({
        channel  : "engine-request",
        topic    : "*",
        callback : function(data, envelope) {
          data.topic = envelope.topic;
github storyteller / Storyteller / client / component-tests / component-harness.jsx View on Github external
constructor(){
        Postal.reset();
        
        this.store = createStore(Reducer);
        this.store.dispatch(initialization);

		this.div = document.createElement('div');
		document.documentElement.appendChild(this.div);

        this.engineMessages = new Listener('engine-request');
        this.editorMessages = new Listener('editor');
        this.explorerMessages = new Listener('explorer');
        
        var SpecEditorPresenter = require('./../lib/presentation/spec-editor-presenter');

        SpecEditorPresenter(this.store, this.engineRequests);
        
        global.$ = $;

postal

Pub/Sub library providing wildcard subscriptions, complex message handling, etc. Works server and client-side.

MIT
Latest version published 3 years ago

Package Health Score

59 / 100
Full package analysis