Skip to content

Commit

Permalink
v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelFernando committed Nov 29, 2017
1 parent 60d4bca commit 9c7fc15
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 66 deletions.
7 changes: 6 additions & 1 deletion .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
name: pubnub-angular2
version: 1.2.0
version: 1.3.0
schema: 1
scm: github.com/pubnub/pubnub-angular2
files:
- dist/pubnub-angular2.js
- dist/pubnub-angular2.min.js
changelog:
- version: v1.3.0
changes:
- type: feature
text: add functions to (fetchMessages and deleteMessages) and keep the stack of messages with only the latest 100
date: Nov 28, 2017
- version: v1.2.0
changes:
- type: feature
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## [v1.3.0](https://github.com/pubnub/pubnub-angular2/tree/v1.3.0)


[Full Changelog](https://github.com/pubnub/pubnub-angular2/compare/v1.2.0...v1.3.0)

- 🌟add functions to (fetchMessages and deleteMessages)
- 🌟keep the stack of messages with only the latest 100




## [v1.2.0](https://github.com/pubnub/pubnub-angular2/tree/v1.2.0)


Expand Down
84 changes: 31 additions & 53 deletions dist/pubnub-angular2.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! 1.2.0 */
/*! 1.3.0 */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
Expand Down Expand Up @@ -177,8 +177,14 @@ return /******/ (function(modules) { // webpackBootstrap
}
}, {
key: 'getMessage',
value: function getMessage(channel, callback) {
return this.getInstance(_config2.default.default_instance_name).getMessage(channel, callback);
value: function getMessage(channel) {
var _getInstance;

for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}

return (_getInstance = this.getInstance(_config2.default.default_instance_name)).getMessage.apply(_getInstance, [channel].concat(args));
}
}, {
key: 'getPresence',
Expand Down Expand Up @@ -217,53 +223,7 @@ return /******/ (function(modules) { // webpackBootstrap
/* 2 */
/***/ (function(module, exports) {

module.exports = {
"pubnub_prefix": "pubnub",
"default_instance_name": "default",
"attributes_to_delegate": [
"channelGroups",
"push"
],
"methods_to_delegate": [
"addListener",
"removeListener",
"removeAllListeners",
"hereNow",
"whereNow",
"getState",
"setState",
"grant",
"audit",
"publish",
"fire",
"history",
"time",
"reconnect",
"stop",
"unsubscribeAll",
"getSubscribedChannels",
"getSubscribedChannelGroups",
"encrypt",
"decrypt",
"getAuthKey",
"setAuthKey",
"setCipherKey",
"getUUID",
"setUUID",
"getFilterExpression",
"setFilterExpression"
],
"common_callbacks_to_wrap": [
"callback",
"error"
],
"subscribe_listener_events_to_broadcast": [
"message",
"presence",
"status"
],
"history_sort_attribute": "timetoken"
};
module.exports = {"pubnub_prefix":"pubnub","default_instance_name":"default","attributes_to_delegate":["channelGroups","push"],"methods_to_delegate":["addListener","removeListener","removeAllListeners","hereNow","whereNow","getState","setState","grant","audit","publish","fire","history","deleteMessages","fetchMessages","time","reconnect","stop","unsubscribeAll","getSubscribedChannels","getSubscribedChannelGroups","encrypt","decrypt","getAuthKey","setAuthKey","setCipherKey","getUUID","setUUID","getFilterExpression","setFilterExpression"],"common_callbacks_to_wrap":["callback","error"],"subscribe_listener_events_to_broadcast":["message","presence","status"],"history_sort_attribute":"timetoken"}

/***/ }),
/* 3 */
Expand Down Expand Up @@ -342,10 +302,22 @@ return /******/ (function(modules) { // webpackBootstrap
}
}, {
key: 'getMessage',
value: function getMessage(channel, callback) {
value: function getMessage(channel) {
var _this = this;

if (this.outputOn.subscribe(channel)) {
var callback = void 0;
var keepMessages = 100;

if ((arguments.length <= 1 ? 0 : arguments.length - 1) === 1 && typeof (arguments.length <= 1 ? undefined : arguments[1]) === 'function') {
callback = arguments.length <= 1 ? undefined : arguments[1];
} else if ((arguments.length <= 1 ? 0 : arguments.length - 1) === 1 && typeof (arguments.length <= 1 ? undefined : arguments[1]) === 'number') {
keepMessages = arguments.length <= 1 ? undefined : arguments[1];
} else if ((arguments.length <= 1 ? 0 : arguments.length - 1) === 2) {
callback = arguments.length <= 1 ? undefined : arguments[1];
keepMessages = arguments.length <= 2 ? undefined : arguments[2];
}

if (this.outputOn.subscribe(channel, keepMessages)) {
this.autoload.getHistory(channel, callback);
}

Expand Down Expand Up @@ -666,13 +638,18 @@ return /******/ (function(modules) { // webpackBootstrap
_classCallCheck(this, Output);

this.channels = {};
this.keepMessages = {};
}

_createClass(Output, [{
key: "push",
value: function push(channel, message) {
if (this.channels[channel]) {
this.channels[channel].push(message);

if (this.keepMessages[channel] && this.channels[channel].length > this.keepMessages[channel]) {
this.channels[channel].splice(0, this.channels[channel].length - this.keepMessages[channel]);
}
}
}
}, {
Expand All @@ -693,9 +670,10 @@ return /******/ (function(modules) { // webpackBootstrap
}
}, {
key: "subscribe",
value: function subscribe(channel) {
value: function subscribe(channel, keepMessages) {
if (!this.channels[channel]) {
this.channels[channel] = [];
this.keepMessages[channel] = keepMessages;
return true;
} else {
return false;
Expand Down
2 changes: 1 addition & 1 deletion dist/pubnub-angular2.min.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion lib/output.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/output.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/pubnub-angular2.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions lib/pubnub-common.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9c7fc15

Please sign in to comment.