Skip to content
roman_lubushkin edited this page Jan 6, 2017 · 3 revisions

Classes

cljs.Site

Site is some sort of entry that represents any kind of client or end-point, it may be browser page, desktop or mobile app or even a server. The main goal of Site is:

  • Store states of all documents related to the Site
  • Receive and process operations (internal or remote) under related documents
  • Generate Undo/Redo operations

Usage Sample

var site = new cljs.Site(); // create site instance  
site.register();            // register related documents  
site.update();              // update documents with remote operations
site.commit();              // commit documents internal operations

Methods

  • id(value):string
  • getState():cljs.Context
  • register(docId, transformFunc, invertFunc, opt_state):void
  • update(packs):UpdateTuple
  • commit(docIdOrMap, opt_opLoad):CommitTuple
  • undo():CommitTuple
  • redo():CommitTuple
  • canUndo():Boolean
  • canRedo():Boolean
Clone this wiki locally