mayteio / use-pusher

👉 Easy as react/native hooks that integrate with the pusher-js library

Home Page:https://use-pusher-docs.netlify.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat: logToConsole

dqn opened this issue · comments

commented
import React from "react";
import { PusherProvider } from "@harelpls/use-pusher";
 
const config = {
  // ...
  logToConsole: true,
  // ...
};
 
const App = () => {
  <PusherProvider {...config}>
    <Example />
  </PusherProvider>;
};

I want this to be:

Pusher.logToConsole = true;

Hey @dqn the provider already passes on all arguments to the new Pusher({..., ...props}) :

export interface PusherProviderProps extends Options {

if it’s something that isn’t an argument, I’d suggest using the usePusher hook:

const { client } = usePusher()
client?.logToConsole = true
commented

Oh, sorry. I didn't check enough. Thanks!

This doesn't seems to work 🤔
Have you been able to test it?