From d8d33bacfae62ae69e0b071b5c2cd56044f4a4dd Mon Sep 17 00:00:00 2001 From: rilaxik Date: Wed, 30 Oct 2024 15:37:56 +0000 Subject: [PATCH] links bump + more setters --- Docs%400.2.0.md | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Docs%400.2.0.md b/Docs%400.2.0.md index 628a215..19c955e 100644 --- a/Docs%400.2.0.md +++ b/Docs%400.2.0.md @@ -36,7 +36,7 @@ Package used on a server-side of your Rage:MP Server ```ts import { fw } from '@entityseven/rage-fw-server' ``` -Only usable in server environment. For usage in [Client](#client) and [Browser](#browser) refer to their sections +Only usable in server environment. For usage in [Client](#client) and [Browser](#browser-1) refer to their sections ## Declaration ```ts @@ -147,7 +147,7 @@ Package used on a client-side of your Rage:MP Server ```ts import { fw } from '@entityseven/rage-fw-client' ``` -Only usable in client environment. For usage in [Server](#server) and [Browser](#browser) refer to their docs +Only usable in client environment. For usage in [Server](#server) and [Browser](#browser-1) refer to their docs ## Declaration ```ts @@ -281,6 +281,20 @@ Further documentation will describe the fields included in ``fw`` ## Browser Browser-side interactions +### debugLogs +Setter. Enables console debug logs for events +```ts +fw.event.debugLogs = true +``` + +### customLogger +Setter. Enables console debug logs for events +```ts +fw.event.customLogger = () => (method: string, eventName: string, ...args: unknown[]) => { + // log with desired formatting +} +``` + ### register Registers a browser event with an associated callback ```ts @@ -289,7 +303,6 @@ fw.event.register("showNotification", (message, color) => { }) ``` - ### unregister Unregisters a browser event, removing the associated callback ```ts @@ -326,6 +339,9 @@ fw.event.triggerClient("clientEventName", ["message to client"]) ## Rpc ``rage-fw-rpc`` instance used under the hood. It is highly recommended to use this one if you need it instead of creating a new instance +### ``forceBrowserDevMode``? +``rage-fw-rpc`` has a setting which enables it to be ran in browser dev mode without MP context ([see Wiki -> Rpc -> Rpc Config](https://git.entityseven.com/entityseven/rage-framework/wiki)). As ``rage-fw-browser`` does not expose Rpc constructor, you can use ``.env`` with ``RageFW_forceBrowserDevMode=true`` to enable it + # Features ## Event Middlewares Rage FW offers you to add middlewares when registering events in Client and Server environments, to check if callback should be executed or should not. Core class functionality is not exposed to user, but some types are for easier code managing. Here are some key points (in context of Server environment, but also applicable to Client)