Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A simple plugin to connect an external Vue app to Meteor's realtime DDP system

NotificationsYou must be signed in to change notification settings

Gregivy/vue-simpleddp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple plugin that usesSimpleDDP to connect an external Vue app to Meteor's DDP system.

Getting Started

Install the package:

npm install vue-simpleddp

Initialize the plugin in your Vue app like below:

importVuefrom'vue';importVueDDPfrom'vue-simpleddp';Vue.use(VueDDP);

Subscribe to data from one of your components like the example below:

exportdefault{components:{      Logo,},data(){return{articles:[],};},created(){(async()=>{awaitthis.$subscribe('articles').catch(console.error);this.articles=this.find('articles');})();},};

Options

You can pass additional options to the plugin to for example specify the endpoint. These options arepassed down to the simpleddp package.

Vue.use(VueDDP,{endpoint:'ws://localhost:3030/websocket',});

Below are some example options.

OptionDefault ValueDescription
endpointws://localhost:3030/websocketThe link to the DDP websocket endpoint (In Meteor its usually ws://{host}/websocket)
wswsA constructor for the websocket library. vue-simpleddp uses isomorphic-ws by default to make it work on client and serverside
reconnectInterval5000The interval in which it tries to reconnect when disconnected from the server

About

A simple plugin to connect an external Vue app to Meteor's realtime DDP system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript100.0%

[8]ページ先頭

©2009-2025 Movatter.jp