1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-26 16:44:22 +02:00

update node and utils docs

This commit is contained in:
Ian Storm Taylor
2016-11-28 10:53:19 -08:00
parent d925940b0d
commit bf99d48ccb
2 changed files with 2 additions and 2 deletions

View File

@@ -44,7 +44,7 @@
A short-lived, unique identifier for the node. 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. 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.

View File

@@ -4,7 +4,7 @@
These are extra utility functions that ship with Slate that may be useful for certain use cases. These are extra utility functions that ship with Slate that may be useful for certain use cases.
## `setKeyGenerator` ### `setKeyGenerator`
`setKeyGenerator(generator: Function) => Void` `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'`, ...) 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'`, ...)