You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MatousMarik opened this issue
Jan 16, 2025
· 0 comments
Labels
featureIssues that represent new features or improvements to existing features.t-toolingIssues with this label are in the ownership of the tooling team.
featureIssues that represent new features or improvements to existing features.t-toolingIssues with this label are in the ownership of the tooling team.
Which package is the feature request for? If unsure which one to select, leave blank
None
Feature
I would love to use any object as a state (e.g., Set), but the function only supports simple objects that are serializable by
JSON.stringify.
Motivation
I write actors, and sometimes, I have to implement everything myself by using
Actor.setValue
sinceActor.useState
is unusable in such cases.Ideal solution or implementation, and any additional constraints
I would add an option to add a custom serialization function for the
useState
. Either as a type of the state e.g.:Or as a parameter e.g. as part of
UseStateOptions
that are documented as follows:Or another optional parameter called
customSerializationFunction
or something like that.Alternative solutions or implementations
No response
Other context
Slack thread: https://apify.slack.com/archives/CD0SF6KD4/p1737024037028519
The text was updated successfully, but these errors were encountered: