1.0.4 • Published 6 months ago

puller-js v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Puller-js

Ajax long-polling library for JavaScript and Laravel Echo

Installation

npm install puller-js

Usage

Laravel Echo

import Puller from 'puller-js';
import Echo from 'laravel-echo';
window.Echo = new Echo({
    broadcaster: Puller.echoConnect,
});

Standalone

import Puller from 'puller-js';
window.Puller=new Puller({
    error_delay: 10000,
    url:'/puller/messages',
    auth: {
        endpoint: '/broadcasting/auth',
        headers: {},
        data:{},
    },
});

// Listen for events
window.Puller.channel('channel-name').listen('event', (data) => {
    console.log(data);
});

// Listen for all events
window.Puller.channel('channel-name').listen('*', (data,event) => {
    console.log(event,data);
});
1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago