Skip to content

Commit

Permalink
docs: Fix import logic and make example easier to understand (#8688)
Browse files Browse the repository at this point in the history
  • Loading branch information
AvilaJulio authored Sep 11, 2024
1 parent cdfbd1e commit ebfdb62
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,20 @@ which is located in a parent directory.
β”œβ”€β”€ README.md
β”œβ”€β”€ cube.js
β”œβ”€β”€ package.json
└── model
β”œβ”€β”€ utils.js
└── sales
└── model/
β”œβ”€β”€ shared_utils/
β”‚ └── utils.js
└── sales/
└── orders.js
```

```javascript
// in model/sales/orders.js
import { capitalize } from "./schema_utils";
import { capitalize } from "./shared_utils/utils";
```

```javascript
// in model/utils.js
// in model/shared_utils/utils.js
export const capitalize = (s) => s.charAt(0).toUpperCase() + s.slice(1);
```

Expand All @@ -124,4 +125,4 @@ export const capitalize = (s) => s.charAt(0).toUpperCase() + s.slice(1);
https://developer.mozilla.org/en-US/docs/web/javascript/reference/statements/export
[mdn-js-es6-import]:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
[ref-schema-string-time-dims]: /guides/recipes/data-modeling/string-time-dimensions
[ref-schema-string-time-dims]: /guides/recipes/data-modeling/string-time-dimensions

0 comments on commit ebfdb62

Please sign in to comment.