service<Id, Data> method
Service<Id, Data>
service<Id, Data>(
- String path, {
- Type? type,
- AngelDeserializer<
Data> ? deserializer,
override
Creates a Service instance that queries a given path on the server.
This expects that there is an Angel Service mounted on the server.
In other words, all endpoints will return Data, except for the root of
path, which returns a List<Data>.
Pass a deserializer to turn the decoded JSON into Data, such as a
generated fromMap. Without one, the decoded JSON is returned as is.
Implementation
@override
Service<Id, Data> service<Id, Data>(
String path, {
Type? type,
AngelDeserializer<Data>? deserializer,
}) {
var uri = path.replaceAll(_straySlashes, '');
return addService<Id, Data>(
BrowserWebSocketsService<Id, Data>(
socket,
this,
uri,
type: type,
deserializer: deserializer,
),
);
}