Skip to content

Commit 144898f

Browse files
committed
Update CHANGELOG.md
1 parent 6b43e7c commit 144898f

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,20 @@ descriptive error is thrown when api is created with the old options format.
5454

5555
* **BREAKING**: Renamed `middlewares` to `middleware` and `:middlewares` key (restructuring) to `:middleware`
5656

57-
* **BREAKING**: Middleware must be defined as data: both our forms take a vector
58-
of middleware containing either a) fully configured mws (function)
59-
or b) a middleware templates in form [function args]. Nothing new, just best practices.
60-
* You can also use anonymous functions to create middleware with correct parameters:
61-
`(middleware [#(wrap-foo % {:opts :bar})])`
57+
* **BREAKING**: Middleware must be defined as data: both middleware macro and :middleware restructuring
58+
take a vector of middleware containing either
59+
* a) fully configured middleware (function), or
60+
* b) a middleware templates in form of `[function args]`
61+
* You can also use anonymous or lambda functions to create middleware with correct parameters,
62+
these are all identical:
63+
* `[[wrap-foo {:opts :bar}]]`
64+
* `[#(wrap-foo % {:opts :bar})]`
65+
* `[(fn [handler] (wrap-foo handler {:opts :bar}))]`
6266
* Similar to [duct](https://github.com/weavejester/duct/wiki/Components#handlers)
6367

68+
69+
70+
6471
### Migration guide
6572

6673
https://github.com/metosin/compojure-api/wiki/Migration-Guide-to-1.0.0

0 commit comments

Comments
 (0)