Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jun 17, 2021
2 parents 18d454b + abca3c7 commit 4316fca
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/1_Bug_report.md
Expand Up @@ -16,3 +16,6 @@ about: "Report something that's broken. Please ensure your Laravel version is st


### Steps To Reproduce:

<!-- If possible, please provide a GitHub repository to demonstrate your issue -->
<!-- laravel new bug-report --github="--public" -->
67 changes: 67 additions & 0 deletions .github/workflows/codeql-analysis.yml
@@ -0,0 +1,67 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '44 23 * * 1'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
3 changes: 1 addition & 2 deletions .github/workflows/tests.yml
Expand Up @@ -8,8 +8,7 @@ on:

jobs:
tests:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- name: Checkout code
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
@@ -1,6 +1,12 @@
# Release Notes

## [Unreleased](https://github.com/laravel/echo/compare/v1.9.0...master)
## [Unreleased](https://github.com/laravel/echo/compare/v1.10.0...master)


## [v1.10.0 (2020-12-19)](https://github.com/laravel/echo/compare/v1.9.0...v1.10.0)

### Added
- Add optional callback argument to `stopListening()` ([#292](https://github.com/laravel/echo/pull/292))


## [v1.9.0 (2020-10-13)](https://github.com/laravel/echo/compare/v1.8.1...v1.9.0)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -5,7 +5,7 @@
"keywords": [
"laravel",
"pusher",
"socket.io"
"ably"
],
"homepage": "https://github.com/laravel/echo",
"repository": {
Expand Down
32 changes: 32 additions & 0 deletions src/channel/pusher-channel.ts
Expand Up @@ -67,6 +67,25 @@ export class PusherChannel extends Channel {
return this;
}

/**
* Listen for all events on the channel instance.
*/
listenToAll(callback: Function): PusherChannel {
this.subscription.bind_global((event, data) => {
if (event.startsWith('pusher:')) {
return;
}

let namespace = this.options.namespace.replace(/\./g, '\\');

let formattedEvent = event.startsWith(namespace) ? event.substring(namespace.length + 1) : '.' + event;

callback(formattedEvent, data);
});

return this;
}

/**
* Stop listening for an event on the channel instance.
*/
Expand All @@ -80,6 +99,19 @@ export class PusherChannel extends Channel {
return this;
}

/**
* Stop listening for all events on the channel instance.
*/
stopListeningToAll(callback?: Function): PusherChannel {
if (callback) {
this.subscription.unbind_global(callback);
} else {
this.subscription.unbind_global();
}

return this;
}

/**
* Register a callback to be called anytime a subscription succeeds.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/channel/socketio-channel.ts
Expand Up @@ -113,7 +113,7 @@ export class SocketIoChannel extends Channel {
on(event: string, callback: Function): SocketIoChannel {
this.listeners[event] = this.listeners[event] || [];

if (! this.events[event]) {
if (!this.events[event]) {
this.events[event] = (channel, data) => {
if (this.name === channel && this.listeners[event]) {
this.listeners[event].forEach((cb) => cb(data));
Expand Down

0 comments on commit 4316fca

Please sign in to comment.