Comments (2)
Hello @naorpeled
Yes, you're right about the assumption that I only want to write at creation time (the default value). I do not use dependsOn
to check for changed property (as for that you could use onUpdate: true
and pass all properties to calculate the default), but I do use it as on the keys (e.g. key4) also uses a function to calculate the default based on another property.
I evaluated my code and found out that dependsOn only needs to be used for properties that have a default value generated, in which case I can shorten the dependsOn graph. Thank you for that insight.
from dynamodb-toolbox.
Hey @Jimmy89,
in this case I think that dependsOn
is redundant, no?
it's a field that you want to only write on creation and not during updates, right? 🙏
Regarding changing the dependsOn
logic to allow checking if at least one property changes also makes sense to me but need to give this more thought.
Probably worth creating additional configuration for that as I wouldn't want to accidentally cause cases where some keys would be malformed (e.g. POSTED-AT_undefined#USER_12345
).
from dynamodb-toolbox.
Related Issues (20)
- ⭐️ Support for transactions
- Provided key element does not match the schema HOT 5
- Type inference for batch operations
- get,put,update method type inference incorrect when extending Entity HOT 3
- Document that `type: "set"` and `convertClassInstanceToMap: true` do not go well together HOT 1
- Attributes with defaults that have depend on unresolvable attribute should be ignored
- Type Inference Issue with `Entity.get()` When Used Inside a Class Constructor HOT 10
- Derived state HOT 5
- Invalid Entity ? Is it related to the some version ? HOT 1
- Type inference of entity using EntityItem<typeof MyEntity> not resolving alias HOT 1
- Inferred Type cannot be named without reference to "ts-toolbelt" HOT 4
- Overlays break many constructor inputs
- Error when importing abstraction that uses dynamodb-toolbox HOT 1
- Bug on Item.get, where unneeded properties are required HOT 2
- Error when sending EntityV2 `GetItemCommand` with property of type `binary()` HOT 2
- Undefined dependencies for Index keys cause Update / Put failures
- Got Error: Please provide a valid entity definition
- Created is changing with puts and is always the same as modified HOT 1
- Is `transform` valid for partition key?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dynamodb-toolbox.