Communicator
This npm module serves as an abstraction for communications with the server
Adding it to a browserify project
npm install frontend-communicator --saveAlternatively the build can be downloaded here
Installing
npm installRunning tests
npm testRunning build
npm run buildTo read more on the build setup, please refer to the build documentation.
Npm scripts
The project comes with a couple npm scripts that can be executed by running
npm run <script>So,
npm run buildfor example. For all npm scripts available please see npm scripts
Concepts
Adapter
Adapters serve to do the actual transport of data.
Adapters are used by Connections to execute Requests.
Connection
Connections serve to represent a connection to a server, it uses an Adapter to do it's transport of data.
Request
Requests are blueprints for executing a request to a server, they can execute themselves using their own Connection, or execute themselves on another Connection.
Walkthrough
For more information, please read the walkthrough, for even more information please refer to the documented Namespaces and Classes.
TODOs
- Add an upload method to the
Adapterspec, add an upload method toConnectionand add an upload flag toRequest - Allow cache lifetime to be configured on Request and Connection level, where Request has precedence