Skip to content

Commit

Permalink
updated for v10 and ESM and dropped uuid in favor of nanoid for reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
br41nslug committed May 5, 2023
1 parent b57cbb2 commit c72691d
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 1,802 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ The package is published to npm:
`mv dist extensions/hooks/directus-websocket-subscribe`
- Restart your Directus instance

(For now the ESM build needs to be done with the main branch)

# Configuration
This extension can be configured in a couple of ways. Either via a custom hook, environment variables or by editing this extension directly.

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/custom-integration/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = function registerHook(_, { emitter }) {
export default function registerHook(_, { emitter }) {
emitter.onFilter('websocket.register', (registerHandler) => {
registerHandler((_, context) => {
const {
Expand All @@ -24,4 +24,4 @@ module.exports = function registerHook(_, { emitter }) {
};
});
});
};
}
4 changes: 2 additions & 2 deletions examples/websocket-configuration/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = function registerHook(_, { logger, emitter }) {
export function registerHook(_, { logger, emitter }) {
emitter.onFilter('websocket.config', (cfg) => {
logger.info('[ ext ] websocket config - ' + JSON.stringify(cfg));
cfg.path = '/test';
logger.info('[ ext ] websocket config - ' + JSON.stringify(cfg));
return cfg;
});
};
}
Loading

0 comments on commit c72691d

Please sign in to comment.