Guides JavaScript
  • API
  • Examples
  • Protocol
  • Github
  • Api / JavaScript /

    addType( type )

    Adds a custom type that will be used when patching or when encode/decode.

    Arguments

    type Object

    Must be an object that expose two or three functions. patch is optional.

    addType({ 
        encode: ()=>{},
        decode: ()=>{},
        patch: ()=>{}
    })
    

    Examples

    To do...

    But for now you can have a look at https://github.com/DistributedObjectProtocol/dop/tree/master/src/types