Skip to content

Commit c76ea4f

Browse files
authored
Update readme.md
1 parent 57d82a1 commit c76ea4f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

readme.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,23 +239,23 @@ The expected structure is as follows:
239239
You can always use another structure, just update your config file to let OpenScript know where to find your components, mediators, and contexts files.
240240

241241
## Other JS files
242-
OpenScript has a built in loader called `autoload`. This loads any JS file as long as the file has only declared contents such as classes and functions. If not, then the loader cannot load such file.
242+
OpenScript has a built-in loader called `autoload`. This loads any JS file as long as the file has only declared contents such as classes and functions. If not, then the loader cannot load such file.
243243
>Please see the ojs-config to understand how to configure the `autoload` object.
244244
245245
## Loading Files
246246
Every file type in the config has a version number. This is because, the browser caches JS files, hence if you change them, you want to update the versions so that a fresh file is loaded.
247247

248248
### Namespacing
249-
All file loaders are of type `OpenScript.AutoLoader`. When an AutoLoader loads a file, it keeps the file in its histories to avoid requesting the file later. Therefore, when you try to load the same file more than once, only one request is made and the rest of the loads only returns the kept file content.
249+
All file loaders are of type `OpenScript.AutoLoader`. When an AutoLoader loads a file, it keeps it in its history to avoid requesting it later. Therefore, when you try to load the same file more than once, only one request is made and the rest of the loads only return the kept file content.
250250

251-
To avoid file clashes, the AutoLoader put the files in a namespace that is similar to the folder structure.
251+
To avoid file clashes, the AutoLoader puts the files in a namespace similar to the folder structure.
252252

253-
For example, a class file with path `js/classes/user/User.js` will be placed in `window.js.classes.user.User`. Therefore, to accesses the class, you need to use `js.classes.user.User.User`.
253+
For example, a class file with path `js/classes/user/User.js` will be placed in `window.js.classes.user.User`. Therefore, to access the class, you need to use `js.classes.user.User.User`.
254254
>**Notice the class name is doubled at the end**.
255255
256-
Imagine that the `User.js` file has two user classes declared in it: `User` and `Admin`. Therefore, it now makes sense to use the file name as part of the namespace because it make contain multiple classes. In the above example, we will use `js.classes.user.User.Admin` to access the admin class.
256+
Imagine that the `User.js` file has two user classes declared in it: `User` and `Admin`. Therefore, it now makes sense to use the file name as part of the namespace because it may contain multiple classes. In the above example, we will use `js.classes.user.User.Admin` to access the admin class.
257257

258-
However, `AutoLoaders` return a map with key-values pairs. Each Key represent 1 declaration in the file. For our example, the `AutoLoader` will return
258+
However, `AutoLoaders` return a map with key-value pairs. Each Key represents 1 declaration in the file. For our example, the `AutoLoader` will return
259259
```javascript
260260
new Map([
261261
[

0 commit comments

Comments
 (0)