mirror of
https://github.com/wassname/talk.git
synced 2026-09-10 12:43:11 +08:00
Initial subscription impl
This commit is contained in:
+4
-1
@@ -31,7 +31,7 @@ const decorateContextPlugins = (context, contextPlugins) => contextPlugins.reduc
|
||||
* Stores the request context.
|
||||
*/
|
||||
class Context {
|
||||
constructor({user = null}) {
|
||||
constructor({user = null}, pubsub) {
|
||||
|
||||
// Load the current logged in user to `user`, otherwise this'll be null.
|
||||
if (user) {
|
||||
@@ -46,6 +46,9 @@ class Context {
|
||||
|
||||
// Decorate the plugin context.
|
||||
this.plugins = decorateContextPlugins(this, contextPlugins);
|
||||
|
||||
// Bind the publish/subscribe to the context.
|
||||
this.pubsub = pubsub;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user