Communicator
This npm module serves as an abstraction for communications with the server
Adding it to a browserify project
npm install frontend-communicator --save
Alternatively the build can be downloaded here
Installing
npm install
Running tests
npm test
Running build
npm run build
To 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 build
for example. For all npm scripts available please see npm scripts
Concepts
Adapter
Adapter
s serve to do the actual transport of data.
Adapter
s are used by Connections
to execute Request
s.
Connection
Connection
s serve to represent a connection to a server, it uses an Adapter
to do it's transport of data.
Request
Request
s 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
Adapter
spec, add an upload method toConnection
and add an upload flag toRequest
- Allow cache lifetime to be configured on Request and Connection level, where Request has precedence