package | from version | to version |
---|---|---|
betsy | 1.0.2 | 1.0.2-1575903734574 |
overmind | 20.0.0 | 21.0.0-1575903734575 |
overmind-angular | 20.0.0 | 21.0.0-1575903734575 |
overmind-devtools | 21.0.0 | 22.0.0-1575903734575 |
overmind-devtools-client | 3.0.0 | 4.0.0-1575903734575 |
overmind-devtools-vscode | 2.0.0 | 3.0.0-1575903734575 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an effect to persist data. For native envs, using something similar | |
// to localStorage | |
const persistedState = { | |
set(state) { | |
localStorage.setItem('state', JSON.stringify(state)) | |
}, | |
get() { | |
return JSON.parse(localStorage.getItem('state') || '{}') | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Add to package JSON script: | |
npm run test:pr ${ID} | |
The ID is the #1234 type of number on the PR | |
*/ | |
const { spawn } = require('child_process'); | |
const { argv } = require('yargs'); | |
const username = require('username'); | |
const id = argv._[0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const createModals = < | |
T extends { | |
[name: string]: { | |
state?: IState; | |
result?: unknown; | |
}; | |
} | |
>( | |
modals: T | |
): { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
OnCallWithServices, | |
ResponseError, | |
OnRequestWithServices, | |
} from './services' | |
import * as Stripe from 'stripe' | |
export const subscribe: OnCallWithServices<{ | |
token: string | |
plans: string[] |
package | from version | to version |
---|---|---|
betsy | 1.0.2 | 1.0.2-1561921753905 |
overmind | 18.0.1 | 19.0.0-1561921753906 |
overmind-angular | 18.0.1 | 19.0.0-1561921753906 |
overmind-devtools | 19.0.1 | 20.0.0-1561921753906 |
overmind-devtools-client | 1.0.0 | 2.0.0-1561921753906 |
overmind-react | 19.0.1 | 20.0.0-1561921753906 |
overmind-themes | 1.0.2 | 1.0.2-1561921753906 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'package:flutter/material.dart'; | |
import 'package:rxdart/rxdart.dart' as rx; | |
Observer currentObserver; | |
class Observer { | |
Map<rx.Observable, StreamSubscription> _subscriptions = Map(); | |
rx.BehaviorSubject _subject = rx.BehaviorSubject(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Store { | |
Store([Store parent = null]) { | |
this.emit = parent == null ? (dynamic action) { | |
if (_subscribers.containsKey(action)) { | |
_subscribers[action].forEach((cb) => cb()); | |
} | |
} : parent.emit; | |
} | |
Map<Action, Set<Function>> _subscribers = new Map(); | |
Function subscribe(List<Action> actions, Function callback) { |
There are several approaches to detecting change, for example:
-
Mobx, Vue js, Overmind JS: Mutation detection using getters/setters or proxies.
-
Redux: Reference comparison, typically combined with immutability (Is previous value different than current?)
-
Cerebral JS: Path matching. With single state trees you can match what paths components depend on with what paths are being mutated in the state tree