@@ -61,7 +61,7 @@ const myLibraryConfig: Library.Config<IMyLibrary> = {
61
61
body: {
62
62
type: DesignToken .Type .Typography
63
63
value : {
64
- fontFamily : ( tokens ) => tokens .typography .fonts .base , // Alias
64
+ fontFamily: Library . derive (( tokens ) => tokens .typography .fonts .base ) , // Alias
65
65
fontSize: " 14px" ,
66
66
fontWeight: 400 ;
67
67
letterSpacing : " 0px" ;
@@ -90,12 +90,12 @@ const config: Library.Config<Colors> = {
90
90
},
91
91
alias: {
92
92
type: DesignToken .Type .Color ,
93
- value : ( tokens ) => tokens .static , // alias to the 'static' token
93
+ value: Library . derive (( tokens ) => tokens .static ) , // alias to the 'static' token
94
94
},
95
95
derived: {
96
96
type: DesignToken .Type .Color ,
97
97
// Operate on the value of the 'alias' token
98
- value : ( tokens ) => darken (tokens .alias .value , 0.3 ),
98
+ value: Library . derive (( tokens ) => darken (tokens .alias .value , 0.3 ) ),
99
99
},
100
100
};
101
101
```
@@ -149,7 +149,10 @@ Change notifications are batched and subscribers get notified each microtask. It
149
149
``` ts
150
150
const library = Library .create ({
151
151
a: { type: DesignToken .Type .Color , value: " #000000" },
152
- b: { type: DesignToken .Type .Color , value : (tokens ) => tokens .a },
152
+ b: {
153
+ type: DesignToken .Type .Color ,
154
+ value: Library .derive ((tokens ) => tokens .a ),
155
+ },
153
156
});
154
157
155
158
library .subscribe ({
0 commit comments