Compare commits

...

2 Commits

Author SHA1 Message Date
b61bf52df9 fix(module,net): add missing context to server message
fix #6
2023-03-03 10:43:13 +01:00
f1dd467c95 fix(doc): typo 2023-03-01 15:15:47 +01:00
2 changed files with 4 additions and 3 deletions

View File

@ -178,6 +178,6 @@ var results = store.query(ctx, "myCollection", {
limit: 10,
offset: 5,
orderBy: "foo",
orderDirection: store.ASC,
orderDirection: store.DIRECTION_ASC,
});
```

View File

@ -38,9 +38,10 @@ func (m *Module) broadcast(call goja.FunctionCall, rt *goja.Runtime) goja.Value
}
data := call.Argument(0).Export()
ctx := context.Background()
msg := module.NewServerMessage(nil, data)
if err := m.bus.Publish(context.Background(), msg); err != nil {
msg := module.NewServerMessage(ctx, data)
if err := m.bus.Publish(ctx, msg); err != nil {
panic(rt.ToValue(errors.WithStack(err)))
}