Maciej Stasiełuk, Vazco.eu
19.11.15
meteor create secret-notes
cd secret-notes
meteor remove blaze-html-templates
meteor add react
meteor add universe:modules universe:collection universe:utilities-react
meteor add kadira:flow-router kadira:react-layout
meteor add semantic:ui flemay:less-autoprefixer
meteor add universe:accounts-ui accounts-password
$ meteor remove autopublish
*nie mylić z "pub/sub pattern"
Po stronie serwera: publikujemy zbiór dokumentów.
Po stronie klienta: subskrybujemy żądaną publikację i otrzymujemy zbiór dokumentów.
Grafika: discovermeteor.com
$ meteor remove insecure
SomeCollection.allow({
insert: function (userId, doc) {
return true;
},
update: function (userId, doc, fields, modifier) {
return true;
},
remove: function (userId, doc) {
return true;
}
});
SomeCollection.deny({
insert: function (userId, doc) {
return false;
},
update: function (userId, doc, fields, modifier) {
return false;
},
remove: function (userId, doc) {
return false;
}
});
Meteor.methods({
sayHello: function (name, surname) {
return 'Hello ' + name + '' + surname;
}
});
Meteor.call('sayHello', 'Maciek', 'Stasieluk', function (err, result) {
console.log(result);
});
Definiowanie metody
Wywoływanie metody
Meteor.apply('sayHello', ['Maciek', 'Stasieluk'], function (err, result) {
console.log(result);
});
Pomysły na funkcjonalności które można wdrożyć samemu i rozbudować projekt: