-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a way to emit custom messages from script
This adds a Channel type that can be deserialized as a script argument. On the wire the argument looks like: { "type": "channel", "value": { "channel": "my-message-channel", "ownership": "root" } } On deserialization this is turned into a function that when called with an argument emits a `script.message` event containing the channel name and the serialized value of the first argument to the function (using a single argument to allow future extensions and because it's close to `postMessage`). This should meet the usecase of allowing client-defined events that are implemented in script e.g. for mutation events.
- Loading branch information
Showing
1 changed file
with
130 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters