Code Monkey home page Code Monkey logo

jpc's People

Contributors

benbucksch avatar neilrashbrook avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

neilrashbrook

jpc's Issues

Support for Observable

On the server

If the server is sending an object that implements Observable (or has a subscribe() method), then:

  • Send the object as type observable instead of plainObject
  • Send the values of all public properties of the object. Also, the values of all public getters.
  • (Make a function isPrivateProperty(propertyName: string) which skips all properties starting with _, starting with #, and possibly others later.)
  • Let the server subscribe to the object.
  • Once the subscriber is called, send the updated property values to the client.

On the client

If the client receives an object of type observable,

  • the client creates a stub (e.g. RemoteObservable), similar to the plain object, but also sets all the properties that the server sent.
  • The object implements Observable with a subscribe() method and remembers the subscribers.
  • If the server sends updated property values, the client updates the local object, and then calls the local subscribers.

Object lifetime

Pay attention for object lifetime.

  • We don't want the client to hold on to objects which don't exist on the server anymore. (Hopefully, the collection observers will take care of that.) In other words, we should not have wild pointers.
  • We don't want the server or client to keep objects alive which represent base objects that have been destroyed. In other words, we should not leak.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.