This commit is contained in:
thosakwe 2017-02-11 22:12:20 -05:00
parent c460d26a7a
commit ce2dda5e08
4 changed files with 21 additions and 13 deletions

View file

@ -1,5 +1,5 @@
# angel_websocket
[![1.0.0-dev+9](https://img.shields.io/badge/pub-1.0.0--dev+9-red.svg)](https://pub.dartlang.org/packages/angel_websocket)
[![1.0.0-dev+10](https://img.shields.io/badge/pub-1.0.0--dev+10-red.svg)](https://pub.dartlang.org/packages/angel_websocket)
[![build status](https://travis-ci.org/angel-dart/websocket.svg)](https://travis-ci.org/angel-dart/websocket)
WebSocket plugin for Angel.

View file

@ -242,36 +242,44 @@ class BaseWebSocketService extends Service {
@override
Future read(id, [Map params]) async {
socket.sink
.add(serialize(new WebSocketAction(id: id, params: params ?? {})));
socket.sink.add(serialize(new WebSocketAction(
eventName: '$path::${ACTION_READ}', id: id, params: params ?? {})));
return null;
}
@override
Future create(data, [Map params]) async {
socket.sink
.add(serialize(new WebSocketAction(data: data, params: params ?? {})));
socket.sink.add(serialize(new WebSocketAction(
eventName: '$path::${ACTION_CREATE}',
data: data,
params: params ?? {})));
return null;
}
@override
Future modify(id, data, [Map params]) async {
socket.sink.add(serialize(
new WebSocketAction(id: id, data: data, params: params ?? {})));
socket.sink.add(serialize(new WebSocketAction(
eventName: '$path::${ACTION_MODIFY}',
id: id,
data: data,
params: params ?? {})));
return null;
}
@override
Future update(id, data, [Map params]) async {
socket.sink.add(serialize(
new WebSocketAction(id: id, data: data, params: params ?? {})));
socket.sink.add(serialize(new WebSocketAction(
eventName: '$path::${ACTION_UPDATE}',
id: id,
data: data,
params: params ?? {})));
return null;
}
@override
Future remove(id, [Map params]) async {
socket.sink
.add(serialize(new WebSocketAction(id: id, params: params ?? {})));
socket.sink.add(serialize(new WebSocketAction(
eventName: '$path::${ACTION_REMOVE}', id: id, params: params ?? {})));
return null;
}
}

View file

@ -38,7 +38,7 @@ class WebSockets extends BaseWebSocketClient {
WebSocketsService service<T>(String path,
{Type type, AngelDeserializer deserializer}) {
String uri = path.replaceAll(_straySlashes, '');
return new WebSocketsService(socket, this, uri, T != dynamic ? T : type);
return new WebSocketsService(socket, this, uri, null);
}
}

View file

@ -2,7 +2,7 @@ name: angel_websocket
description: WebSocket plugin for Angel
environment:
sdk: ">=1.19.0"
version: 1.0.0-dev+9
version: 1.0.0-dev+10
author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/angel_websocket
dependencies: