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

common: deprecate dataValue #484

Open
josephjclark opened this issue Mar 18, 2024 · 1 comment
Open

common: deprecate dataValue #484

josephjclark opened this issue Mar 18, 2024 · 1 comment

Comments

@josephjclark
Copy link
Collaborator

And maybe some similar functions (sourceValue? asData?) - although we have to be careful that they are not used internally.

I don't think they're particularly useful in modern job writing and should be de-listed, removing clutter from the docs.

Another approach to these would be to mark them private, so they're just hidden from docs.

As part of this work, we need to go through the docs and remove example code that uses dataValue

@josephjclark
Copy link
Collaborator Author

Speaking with Taylor this morning we are almost ready to remove dataValue and focus on lazy state as the official idiomatic way to read state.

One possible problem with dataValue is that the docs say it's an Operation (well, a function that returns an operation). But the signature is not (path) => (state) => State, it's signature is (path) => (state) => any, where any is some value, usually a primitive.

The point is that dataValue returns a function that takes state and returns a value. It does not take state and return state.

It's a small pedantic detail but it becomes quite important when splitting the docs into Operations and Functions, like in #613

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

No branches or pull requests

1 participant