I hereby claim:
- I am georgesboris on github.
- I am georgesboris (https://keybase.io/georgesboris) on keybase.
- I have a public key ASBPQqvoA-3PqVn4KlDGU7eNU95Xv79aEpSd9yo-BH5SuAo
To claim this, I am signing this object:
let createPosX = 300; | |
let createPosY = 300; | |
let createTargetX = 300; | |
let createTargetY = 300; | |
let time_ = 0; | |
function setup() { | |
createCanvas(600, 600); |
// | |
// # Async Flutter Programming | |
// | |
// 1. Let's use our API class to fetch our users and list them. | |
// 2. Where should we trigger these requests? | |
// 3. Where should we store this state? | |
// | |
// 4. Extra: Let's pretend "UserAvatar" is quite an expensive widget. | |
// How would we refactor our code to make sure we don't re-build all "UserAvatar"s everytime | |
// one of the user score changes? |
import 'package:flutter/material.dart'; | |
void main() { | |
// where the magic happens | |
Stack stack = Stack(title: "Magic "); | |
print(stack._list); | |
stack.push(1); | |
stack.push(2); | |
stack.push(3); | |
print(stack._list); |
class SingletonValueNoFactory { | |
static SingletonValueNoFactory _instance; | |
final dynamic value; | |
SingletonValueNoFactory._internal(this.value); | |
static SingletonValueNoFactory getInstance(value) { | |
return _instance ??= SingletonValueNoFactory._internal(value); | |
} |
I hereby claim:
To claim this, I am signing this object:
import { paths } from '../firebase-app' | |
import { FirebaseSync, firebaseSyncConnect } from '../firebase-sync' | |
const User = () => ( | |
<div> | |
<FirebaseSync | |
path={paths.user(props.userId)} /> | |
{user && ( |
const { applyAction } = require('../firebase-app'); | |
// create our local database | |
let db = {}; | |
// first user signs up and creates the first post | |
db = applyAction(createUser, createUserPayload, db); | |
db = applyAction(createPost, createPostPayload, db); | |
db = applyAction(updatePost, updatePostPayload, db); |
require('firebase-app/rules')({ | |
rules: '/firebase-app/**/*.rules.js', | |
filename: '/database.rules.json', | |
actions: require('./actions/actions'), | |
owners: require('./owners/owners'), | |
paths: require('./paths/paths') | |
}); |
// first setup your mocha env as described on targaryen's docs. | |
// ...then: | |
const { paths, actions, getActionUpdates, applyAction } = require('../firebase-app'); | |
describe('firebase-app userflow', () => { | |
it('should be able to update post if is author', () => { | |
const { updates } = getActionUpdates(updatePost, { | |
post: 'post_1', |
module.exports = { | |
__setup__: 'actions', | |
// notice we are defining the rules for a task with this ID. | |
// this has nothing to do with paths. we may access this task payload as shown below. | |
// here we're checking if the post we're updating was created by the authenticated user. | |
updatePost: `newData.child('createdBy').val() == auth.uid` | |
}; |