empiricaly / empirica

Open source project to tackle the problem of long development cycles required to produce software to conduct multi-participant and real-time human experiments online.
https://empirica.ly/
Apache License 2.0
43 stars 8 forks source link

feat: add ephemeral attribute support #533

Closed npaton closed 3 months ago

npaton commented 3 months ago

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 }
changeset-bot[bot] commented 3 months ago

🦋 Changeset detected

Latest commit: 0b130847783cf80352a57a800cc4c1bc43edf806

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