
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
vue-deepstream-connector
Advanced tools
A bridge connector between Vue and Deepstream.
The vue-deepstream-connector allows to intercepts vue's array change detection methods to trigger deepstream's API. It combines them to offer a bidirectional data-sync option.
Load the library (either for browser and Node):
Vue.use(VueDeepStreamConnector)
Sync usage:
sync: {
'some-key': function(){
// It returns a deepstream source
}
}
<script type="text/javascript" src="http://cdn.jsdelivr.net/vue/1.0.26/vue.min.jss"></script>
<script type="text/javascript" src="assets/js/vdc.min.js"></script>
Connect to the deepstream server. Use a custom option named 'ds' always in the root component
var demo = new Vue({
ds: {connectionUrl: 'localhost:6020',
options: {
//deepstream client connection options
//find them here: https://deepstream.io/docs/client-js/options/
}
}, // You may omit the option object completely
el: '#demo',
data: {
// Your data here
}
})
Login to the deepstream server
this.$dsLogin({username: 'uid', password: 'pwd'}, function(logged, data){
// logged is either false or true
})
}
Sync a single deepstream record:
sync: {
object: function(){ // params: recordName
return this.$dsRecordFetch('welcome')
}
Sync a whole array/list:
sync: {
conversations: function(){ // params: listName
return this.$dsListFetch('chats')
} // to insert items in the list use this.conversations.push(object)
// to remove items from the list use this.conversations.$remove(object)
Sync v-model: Use the ds-sync filter
<textarea rows="4" cols="50" v-model="editable | ds-sync 'editable'"></textarea>
Retrieve the exact field:
sync: {
editable: function(){ // params: recordName, fieldName
return this.$dsRecordFieldFetch('myRecord', 'myField')
}
// using the ds-sync filter will update real-time all the connected clients
npm install deepstream.io // install the server
npm install vue-deepstream-connector // install both client@1.x.x and the connector
Same as the animated gif example
git clone https://github.com/ecerroni/vue-deepstream-connector.git
cd vue-deepstream-connector
cd example
npm install
node server
Open the browser at http://localhost:6020
this.$dsLogin // return a callback with the login result status this.$dsLogout // logouts the user closing the connection. You may now login with another user this.$dsRecordFieldFetch // reactive deepstream source: a specific record's field this.$dsListFetch // reactive deepstream source: a list that can be populate with Vue's array mutation functions this.$dsRecordCreate // create a record with or without a unique id this.$dsConnect //use the 'ds' customOption instead, see above
So far the vue-deepstream-connector works with:
Compatibility with vue 2.0 is in the works
In order to make everything sync seamlessly a "_uid" property is added to every object inserted into the array This allows an optimistic UI where the new item triggers a View update on the client without waiting the response of the server
The connector works well with dynamic components as long as you're working with props.
If a child component use a method to fetch anything from deepstream you must use the keep-alive param (either in vue-router or is:currentView) to preserve its state and avoid re-rendering
MIT
FAQs
vue.js deepstream connector for seamless integration
We found that vue-deepstream-connector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.