Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ephemeral attribute support #533

Merged
merged 1 commit into from
Mar 31, 2024

Conversation

npaton
Copy link
Contributor

@npaton npaton commented Mar 31, 2024

Add ephemeral attribute support.

This allows you to define attributes that are not persisted to the database, but
are available to the client and server while the server is still running. These
attributes will sync with all players as normal attributes. This is useful for
data that that would be unreasonable to persist to the database due to size or
volatility, but is still useful to share between clients and the server.

For example, you could use this to sync the mouse movements of the players.

player.set("mouse", { x: 123, y: 456 }, { ephemeral: true });
player.get("mouse"); // { x: 123, y: 456 }

Copy link

changeset-bot bot commented Mar 31, 2024

🦋 Changeset detected

Latest commit: 0b13084

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@empirica/core Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@npaton npaton linked an issue Mar 31, 2024 that may be closed by this pull request
2 tasks
@npaton npaton merged commit d5c6969 into empiricaly:main Mar 31, 2024
1 check passed
@npaton npaton deleted the feat/add-ephemeral-attributes branch March 31, 2024 01:11
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.

Non-persistent attributes
1 participant