UNPKG

951 BTypeScriptView Raw
1declare const _default: object;
2/**
3 Use the `{{hash}}` helper to create a hash to pass as an option to your
4 components. This is specially useful for contextual components where you can
5 just yield a hash:
6
7 ```handlebars
8 {{yield (hash
9 name='Sarah'
10 title=office
11 )}}
12 ```
13
14 Would result in an object such as:
15
16 ```js
17 { name: 'Sarah', title: this.get('office') }
18 ```
19
20 Where the `title` is bound to updates of the `office` property.
21
22 Note that the hash is an empty object with no prototype chain, therefore
23 common methods like `toString` are not available in the resulting hash.
24 If you need to use such a method, you can use the `call` or `apply`
25 approach:
26
27 ```js
28 function toString(obj) {
29 return Object.prototype.toString.apply(obj);
30 }
31 ```
32
33 @method hash
34 @param {Object} options
35 @return {Object} Hash
36 @public
37 */
38export default _default;
39//# sourceMappingURL=hash.d.ts.map
\No newline at end of file