2.0.0 • Published 10 years ago

otalk-chat-input-view v2.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
10 years ago

otalk-chat-input-view

A chat input widget that can track typing states, and handle editing previous messages.

Installing

$ npm install otalk-chat-input-view

Using

var ChatInputView = require('otalk-chat-input-view');

var client = SomeRealtimeConnection();
var peer = SomeContactModel();

var view = new ChatInputView({
    sendChat: function (body, prevID) {
        client.sendChat({
            to: peer.id,
            body: body,
            replace: prevID
        });
    },
    sendChatState: function (state) {
        client.sendChatState({
            to: peer.id,
            chatState: state
        });
    },
    previousMessage: function () {
        return {
            id: peer.lastSentMessage.id,
            body: peer.lastSentMessage.body
        };
    }
});

License

MIT

Created By

If you like this, follow @lancestout on twitter.

2.0.0

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

11 years ago

1.0.1

11 years ago

1.0.0

11 years ago