mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-25 08:11:53 +02:00
update node and utils docs
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
|
||||
A short-lived, unique identifier for the node.
|
||||
|
||||
By default, keys are not meant to be long-lived unique identifiers for nodes that you might store in a database, or elsewhere. They are meant purely to identify a node inside of a single Slate instance. For that reason, they are simply auto-incrementing strings. (eg. `'0'`, `'1'`, `'2'`, ...)
|
||||
By default, keys are **not** meant to be long-lived unique identifiers for nodes that you might store in a database, or elsewhere. They are meant purely to identify a node inside of a single Slate instance. For that reason, they are simply auto-incrementing strings. (eg. `'0'`, `'1'`, `'2'`, ...)
|
||||
|
||||
If you want to make your keys uniqueness long-lived, you'll need to supply your own key generating function via the [`setKeyGenerator`](../utils/utils.md#setkeygenerator) util.
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
These are extra utility functions that ship with Slate that may be useful for certain use cases.
|
||||
|
||||
|
||||
## `setKeyGenerator`
|
||||
### `setKeyGenerator`
|
||||
`setKeyGenerator(generator: Function) => Void`
|
||||
|
||||
Allows you to specify your own key generating function, instead of using Slate's built-in default generator which simply uses auto-incrementing number strings. (eg. `'0'`, `'1'`, `'2'`, ...)
|
||||
|
Reference in New Issue
Block a user