1.0.64 • Published 6 years ago

lanurite v1.0.64

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

Lanurite

Library for Models and Collection use in JS worlds

Documentation: https://pxyup.github.io/lanurite/

NPM

For use in browser

<script src="../dist/lanurite.js"></script>

For use in TypeScript

import * as Lanurite from "lanurite"
console.log(Lanurite.version)

For use in NodeJS

var Lanurite = require("lanurite");
console.log(Lanurite.version)

Example

let model = new Lanurite.Model({name: "Robot"});
document.getElementById("test").innerHTML = model.get("name");

model.on("change", function (e) {
    document.getElementById("test").innerHTML = model.get("name")
    model.off("change", log)
});

let collection = new Lanurite.Collection();

collection.on("add", function (model) {
    document.getElementById("collection").innerHTML += model.get("name") + "<br>"
})

collection.on("clear", function () {
    document.getElementById("collection").innerHTML = "";
});

model.on("change", log);

collection.on("reset", function () {
    getCollectionDOM();
});

getCollectionDOM();

function log(event){
    console.log(event)
}

function getCollectionDOM() {
    document.getElementById("collection").innerHTML = "";
    collection.each((el) => {
        document.getElementById("collection").innerHTML += el.get("name") + "<br>"
    });
}
1.0.64

6 years ago

1.0.63

6 years ago

1.0.62

7 years ago

1.0.61

7 years ago

1.0.60

7 years ago

1.0.58

7 years ago

1.0.57

7 years ago

1.0.56

7 years ago

1.0.55

7 years ago

1.0.54

7 years ago

1.0.53

7 years ago

1.0.51

7 years ago

1.0.49

7 years ago

1.0.48

7 years ago

1.0.47

7 years ago

1.0.46

7 years ago

1.0.45

7 years ago

1.0.44

7 years ago

1.0.43

7 years ago

1.0.42

7 years ago

1.0.41

7 years ago

1.0.40

7 years ago

1.0.39

7 years ago

1.0.38

7 years ago

1.0.36

7 years ago

1.0.34

7 years ago

1.0.33

7 years ago

1.0.32

7 years ago

1.0.31

7 years ago

1.0.30

7 years ago

1.0.29

7 years ago

1.0.28

7 years ago

1.0.27

7 years ago

1.0.26

7 years ago

1.0.23

7 years ago

1.0.22

7 years ago

1.0.21

7 years ago

1.0.20

7 years ago

1.0.19

7 years ago

1.0.18

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.7

7 years ago

1.0.4

7 years ago

1.0.2

7 years ago