Almin 0.10.0: TypeScript, FlowType, Logger

@azu azu released this Mar 7, 2017 · 446 commits to master since this release

Breaking Changes

  • #68 Convert to TypeScript

Almin's code base is converted to TypeScript.

You can use almin with JavaScript, FlowType and TypeScript.

  • #62 #61 Introduce meta for dispatcher

0.9:

context.onWillExecuteEachUseCase(payload => {
    console.log(payload.args, payload.useCase);
});
context.onDidExecuteEachUseCase(payload => {
    console.log(payload.value, payload.useCase);
});
context.onCompleteEachUseCase(payload=> {
    console.log(payload.value, payload.useCase);
});
context.onErrorDispatch(payload => {
    console.log(payload.error);
});
context.onDispatch(payload => {
    console.log(payload.type);
});

0.10:

You can get useCase via meta object.

context.onWillExecuteEachUseCase((payload: WillExecutedPayload, meta: DispatcherPayloadMeta) => {
    console.log(payload.args, meta);
});
context.onDidExecuteEachUseCase((payload: DidExecutedPayload, meta: DispatcherPayloadMeta) => {
    console.log(payload.value, meta);
});
context.onCompleteEachUseCase((payload: CompletedPayload, meta: DispatcherPayloadMeta) => {
    console.log(payload.value, meta);
});
context.onErrorDispatch((payload: ErrorPayload, meta: DispatcherPayloadMeta) => {
    console.log(payload.error, meta);
});
context.onDispatch((payload: Payload, meta: DispatcherPayloadMeta) => {
    console.log(payload.type, meta);
});
  • #64 Store#onError is depreacted
    • You can use UseCase#dispatch insteadof it.
  • #81 #80 Store#onChange(cb: (hangingStores: Array<StoreLike>) => void): () => void {}
    • StoreGroup is not changed. This affect the user that use directly Store class.
  • #87 #86 Remove ***Payload.Type static property
  • #94 Internal: use named exports insteadof default exports
  • #93 Update Flow definition
  • Almin-logger support almin 0.10

Documentation

  • #65 #97 Update Documentation

Performance Improvements