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
{{ message }}
This repository was archived by the owner on Mar 20, 2022. It is now read-only.
consttweet=newschema.Entity('tweets', { user: user }, {
106
141
idAttribute:'id_str',
@@ -117,6 +152,18 @@ const tweet = new schema.Entity('tweets', { user: user }, {
117
152
constnormalizedData=normalize(data, tweet);
118
153
```
119
154
155
+
#### Output
156
+
157
+
```js
158
+
{
159
+
entities: {
160
+
tweets: { '123': { id_str:'123', user:'456' } },
161
+
users: { '456': { id_str:'456', name:'Jimmy' } }
162
+
},
163
+
result:'123'
164
+
}
165
+
```
166
+
120
167
### `Object(definition)`
121
168
122
169
Define a plain object mapping that has values needing to be normalized into Entities. *Note: The same behavior can be defined with shorthand syntax: `{ ... }`*
@@ -132,16 +179,27 @@ You *do not* need to define any keys in your object other than those that hold o
Describe a schema which is a union of multiple schemas. This is useful if you need the polymorphic behavior provided by `schema.Array` or `schema.Values` but for non-collection fields.
@@ -160,7 +218,7 @@ Can be a string or a function. If given a function, accepts the following argume
0 commit comments