setValue

inline suspend fun <T> setValue(value: T?, buildSettings: EncodeSettings.Builder.() -> Unit = {})(source)
inline suspend fun <T> setValue(strategy: SerializationStrategy<T>, value: T, buildSettings: EncodeSettings.Builder.() -> Unit = {})(source)

Ensure the data at this location is set to the specified value when the client is disconnected (due to closing the browser, navigating to a new page, or network issues).

This method is especially useful for implementing "presence" systems, where a value should be changed or cleared when a user disconnects so that they appear "offline" to other users.

Parameters

value

The value to be set when a disconnect occurs or null to delete the existing value


inline suspend fun <T> setValue(value: T?, encodeDefaults: Boolean)(source)

Deprecated

Deprecated. Use builder instead

Replace with

setValue(value) { this.encodeDefaults = encodeDefaults }

Ensure the data at this location is set to the specified value when the client is disconnected (due to closing the browser, navigating to a new page, or network issues).

This method is especially useful for implementing "presence" systems, where a value should be changed or cleared when a user disconnects so that they appear "offline" to other users.

Parameters

value

The value to be set when a disconnect occurs or null to delete the existing value


suspend fun <T> setValue(strategy: SerializationStrategy<T>, value: T, encodeDefaults: Boolean)(source)

Deprecated

Deprecated. Use builder instead

Replace with

setValue(strategy, value) { this.encodeDefaults = encodeDefaults }

Ensure the data at this location is set to the specified value when the client is disconnected (due to closing the browser, navigating to a new page, or network issues).

This method is especially useful for implementing "presence" systems, where a value should be changed or cleared when a user disconnects so that they appear "offline" to other users.

Parameters

value

The value to be set when a disconnect occurs or null to delete the existing value