Skip to content

keep_live access callback result in subscribe #122

@xanderio

Description

@xanderio

Describe the bug

When setting up a keep_live it's currently impossible to access the callback result for setting up any subscriptions.

To Reproduce
A minimal set of resource definitions and calls that can reproduce the bug.

socket
|> keep_live(
  :merge_request,
  fn socket ->
    Nxy.Workspace.MergeRequest.get_by_id!(params["id"])
  end,
  subscribe: [
    "merge_request:updated:#{socket.assigns.merge_request.project_id}" # <-- unable to access the project_id here
  ]
)

Expected behavior

subscription should could be a callback that get's the result of the previous callback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions