Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

wings-feathers

2.0.12 • Public • Published

A FeathersJS reactive data sync for any framework
Follow our FB community https://fb.com/webmobile.ph/ | https://fb.com/groups/webmobile.ph/

WingsJS

A FeathersJS reactive data sync for any framework

Installation

npm install --save wings-feathers

Usage

Configure feathers and WingsJS

import io from 'socket.io-client'
import feathers from '@feathersjs/feathers'
import auth from '@feathersjs/authentication-client'
import socketio from '@feathersjs/socketio-client'
 
import wings from 'wings-feathers'
 
let socket = io('http://localhost:3030') // IP and port of the server
let app = feathers()
 
app
  .configure(socketio(socket))
  .configure(auth({
    storage: window.localStorage // Passing a WebStorage-compatible object to enable automatic storage on the client.
  }))
 
wingsJS = wings(app)
app.serve('collection') // Name of the Service or Collection
export default wingsJS

Data-Binding update models and view templates

// wingsJS is a normal feathers instance that has services. In this case, there's a service named "collection"
wingsJS.services.collection.onDataChange(data => {
  this.apps = data
})

View / Template

<ul>
  <li v-for="r in collection" :key="r._id">
    {{r.name}}
  </li>
</ul>

Service methods See docs for more info https://docs.feathersjs.com/api/services.html

wingsJS.services.collection.find({}).then(result => {
  console.log(result)
})
 
wingsJS.services.collection.create({key1: 'hello World'}).then(result => {
  console.log(result)
})
 

install

npm i wings-feathers

Downloadsweekly downloads

19

version

2.0.12

license

ISC

last publish

collaborators

  • avatar