Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
build
build
yarn-error.log
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Stream chat React Native Devtools is a collection of all the development tools y

## 📝 Tools Available

- The `useFlipper` hook to debug the SDK with [Flipper](https://fbflipper.com/docs/extending/flipper-plugin/). To use follow the guide [here]().
- The `useFlipper` hook to debug the SDK with [Flipper](https://fbflipper.com/docs/extending/flipper-plugin/). To use follow the guide [here](https://getstream.io/chat/docs/sdk/reactnative/guides/debug-mode-using-flipper-plugin/).

## ⚙️ How to use the package?

Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"name": "stream-chat-react-native-devtools",
"version": "1.0.0",
"version": "1.1.0",
"description": "Developer tools for Stream Chat React Native",
"main": "src/index.tsx",
"main": "src/index.ts",
"author": "Stream.io Inc",
"license": "SEE LICENSE IN LICENSE",
"files": [
"build"
"build",
"src"
],
"homepage": "https://github.com/GetStream/stream-chat-react-native-devtools",
"repository": {
Expand All @@ -27,8 +28,8 @@
"@types/react": "17.0.2",
"react-native-flipper": "^0.158.0",
"stream-chat": "^6.8.0",
"stream-chat-react-native": "^5.0.0",
"stream-chat-react-native-core": "^5.0.0",
"stream-chat-react-native": "^5.2.0",
"stream-chat-react-native-core": "^5.2.0",
"typescript": "^4.7.4"
},
"peerDependencies": {
Expand Down
File renamed without changes.
34 changes: 18 additions & 16 deletions src/useFlipper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,32 @@ export function useFlipper<
await connectionRef.current?.send(action, data);
};

const receive = async (
methodName: string,
listener: (...args: any[]) => Promise<any>
) => {
await connectionRef.current?.receive(methodName, listener);
};
// Receive isn't supported yet
// const receive = async (
// methodName: string,
// listener: (...args: any[]) => Promise<any>
// ) => {
// await connectionRef.current?.receive(methodName, listener);
// };

const updateData = async (
ref: React.RefObject<DebugContextValue<StreamChatGenerics>>
) => {
if (ref.current) {
const { eventType, sendEventParams, receiveEventParams } =
ref.current;
const { eventType, sendEventParams } = ref.current;
if (eventType === "send" && sendEventParams) {
await send(sendEventParams.action, sendEventParams.data);
} else if (
ref.current.eventType === "receive" &&
receiveEventParams
) {
await receive(
receiveEventParams.methodName,
receiveEventParams.listener
);
}
// Receive isn't supported yet
// else if (
// ref.current.eventType === "receive" &&
// receiveEventParams
// ) {
// await receive(
// receiveEventParams.methodName,
// receiveEventParams.listener
// );
// }
}
};

Expand Down
Loading
Loading