Skip to content

Document async task closures that use $this for mobile v4 - #625

Open
gwleuverink wants to merge 14 commits into
docs/async-task-allfrom
docs/async-task-closures
Open

gwleuverink wants to merge 14 commits into
docs/async-task-allfrom
docs/async-task-closures

Conversation

@gwleuverink

@gwleuverink gwleuverink commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Sits on docs/async-task-all. The async tasks page explains the work closures of NativePHP/mobile-air#791. Draft until that PR is merged.

"The work closure must be static" becomes "The work closure":

  • Passing data to the work, and using $this in it.
  • The work runs on a copy of the screen: an assignment in the work is lost, a later change to the screen doesn't reach it, and the result is assigned in finished().
  • Which callbacks run on the copy, what the copy has, and what it can't do, such as navigate() and dispatch().
  • What can't be sent.
  • When a static closure is the better choice.

The testing section and the reminders at the end follow. The samples that read well with static keep it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant