File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -158,12 +158,13 @@ the supplied keys (and any referenced keys). For example:
158
158
159
159
#### Initializer functions
160
160
161
- Sometimes all that is necessary is ` init-key ` , particularly if what is being
162
- initiated is all in memory, and we can rely on the garbage collector to clean
163
- up afterwards.
161
+ Sometimes all that is necessary is ` init-key ` , particularly if what is
162
+ being initiated is all in memory, and we can rely on the garbage
163
+ collector to clean up afterwards.
164
164
165
- For this purpose, ` init-key ` will try to find a function matching the key if
166
- no more specific method is set. For example:
165
+ For this purpose, ` init-key ` will try to find a function with the
166
+ ** same namespace and name** as the keyword, if no more specific method
167
+ is set. For example:
167
168
168
169
``` clojure
169
170
(def config
@@ -182,9 +183,9 @@ The `sugared-greet` function is equivalent to the `init-key` method:
182
183
(println " Hi" name))
183
184
```
184
185
185
- Note that the function needs to be in a loaded namespace for ` init-key ` to find
186
- it. The ` integrant.core/load-namespaces ` function can be used on a configuration
187
- to load namespaces matching the keys.
186
+ Note that the function needs to be in a loaded namespace for ` init-key `
187
+ to find it. The ` integrant.core/load-namespaces ` function can be used on
188
+ a configuration to load namespaces matching the keys.
188
189
189
190
190
191
### Suspending and resuming
You can’t perform that action at this time.
0 commit comments