Coder Social home page Coder Social logo

leetcode-opensource / ayanami Goto Github PK

View Code? Open in Web Editor NEW
135.0 8.0 11.0 4 MB

🍭 A better way to react with state

License: MIT License

JavaScript 0.37% TypeScript 99.56% Shell 0.07%
react-hooks state-management rxjs react reactive reactive-programming reactivex redux decorators reflect

ayanami's People

Contributors

brooooooklyn avatar dependabot-preview[bot] avatar dependabot[bot] avatar forehalo avatar greenkeeper[bot] avatar greenkeeperio-bot avatar infinitexyy avatar miloas avatar runjuu avatar zry656565 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ayanami's Issues

Remove setStateAction API

Currently, setStateAction is used in Effect to update state, which is actually the responsibility of Reducer. Effect should only perform side-effects and dispatch actions. So please remove this API.

An in-range update of @types/lodash is breaking the build 🚨

The devDependency @types/lodash was updated from 4.14.126 to 4.14.127.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/lodash is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: build: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @typescript-eslint/eslint-plugin is breaking the build 🚨

The devDependency @typescript-eslint/eslint-plugin was updated from 2.1.0 to 2.2.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@typescript-eslint/eslint-plugin is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: build: Your tests passed on CircleCI! (Details).
  • ci/circleci: test: Your tests failed on CircleCI (Details).

Release Notes for v2.2.0

2.2.0 (2019-09-09)

Bug Fixes

  • eslint-plugin: [efrt] allowExpressions - check functions in class field properties (#952) (f1059d8)
  • eslint-plugin: [expl-member-a11y] fix parameter properties (#912) (ccb98d8)
  • eslint-plugin: [prefer-readonly] add handling for destructuring assignments (e011e90)

Features

  • eslint-plugin: add brace-style [extension] (#810) (e01dc5f)
Commits

The new version differs by 10 commits.

  • d8767f0 chore: publish v2.2.0
  • f1059d8 fix(eslint-plugin): [efrt] allowExpressions - check functions in class field properties (#952)
  • e011e90 fix(eslint-plugin): [prefer-readonly] add handling for destructuring assignments
  • e01dc5f feat(eslint-plugin): add brace-style [extension] (#810)
  • e9fcf70 docs: Update supported TypeScript version range (#951)
  • 6a5c77c docs(eslint-plugin): fix formatting typo
  • 736a074 docs(eslint-plugin): explicitly document mixed codebase usage fo… (#939)
  • ccb98d8 fix(eslint-plugin): [expl-member-a11y] fix parameter properties (#912)
  • 0f63e3f chore: support typescript 3.6 (#916)
  • 9fce08d chore(README): update notes regarding releases (#936)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Provide a way to use Ayanami in a non-singleton pattern

solution A: using decorators to distinguish singleton or non-singleton

@Singleton()
class SomeThing extends Ayanami {}

@Transient()
class AnotherThing extends Ayanami {}

solution B: export another class for non-singleton usage

class SomeThing extends NonSingletonAyanami {}

考虑支持类似mobx的computed特性吗

现在ayanami的类不支持使用getter,能否通过computed装饰器增加对getter的支持?
使用起来类似这样:
@computed get totalPrice() { const good = goodList[this.index] return good.number * good.price; }

An in-range update of @typescript-eslint/parser is breaking the build 🚨

The devDependency @typescript-eslint/parser was updated from 2.3.0 to 2.3.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@typescript-eslint/parser is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: build: Your tests passed on CircleCI! (Details).
  • ci/circleci: test: Your tests passed on CircleCI! (Details).
  • codecov/project: 94.86% (-0.2%) compared to 07d525c (Details).
  • codecov/patch: Coverage not affected when comparing 07d525c...d3a4b11 (Details).

Release Notes for v2.3.1

2.3.1 (2019-09-23)

Bug Fixes

  • eslint-plugin: [cons-type-assns] handle namespaced types (#975) (c3c8b86)
  • eslint-plugin: [pfa] Allow async getter/setter in classes (#980) (e348cb2)
  • typescript-estree: parsing error for await in non-async func (#988) (19abbe0)
Commits

The new version differs by 6 commits.

  • 6279c5b chore: publish v2.3.1
  • ca8ac79 docs(eslint-plugin): add missing ROADMAP link (#998)
  • dfb4fd6 docs(typescript-estree): correct typo (#995)
  • 19abbe0 fix(typescript-estree): parsing error for await in non-async func (#988)
  • c3c8b86 fix(eslint-plugin): [cons-type-assns] handle namespaced types (#975)
  • e348cb2 fix(eslint-plugin): [pfa] Allow async getter/setter in classes (#980)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Consider about ImmerReducer

Using immer in complicated state is much more concise than POJ.
For example:

interface State: {
  ui: {
    comments: { [index: string]: Array<Comment> }
  }
}
@ImmerReducer()
addComment(state: State, { payload }: Action<{ articleId: string, comment: Comment }>) {
  state.ui.comments[payload.articleId].push(payload.comment)
}

vs

@Reducer()
addComment(state: State, { payload }: Action<{ articleId: string, comment: Comment }>) {
  const comments = state.ui.comments.get(payload.article)
  return { ...state, ui: { ...state.ui, comments: { ...state.ui.comments, [payload.articleId]: [...comments, payload.comment] } } }
}

An in-range update of @typescript-eslint/eslint-plugin is breaking the build 🚨

The devDependency @typescript-eslint/eslint-plugin was updated from 1.11.0 to 1.12.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@typescript-eslint/eslint-plugin is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: build: Your tests passed on CircleCI! (Details).
  • ci/circleci: test: Your tests failed on CircleCI (Details).

Release Notes for v1.12.0

1.12.0 (2019-07-12)

Bug Fixes

  • eslint-plugin: handle const; (#633) (430d628), closes #441
  • typescript-estree: fix async identifier token typed as Keyword (#681) (6de19d3)

Features

  • eslint-plugin: [ban-types] Support namespaced type (#616) (e325b72)
  • eslint-plugin: [explicit-function-return-type] add handling for usage as arguments (#680) (e0aeb18)
  • eslint-plugin: [no-explicit-any] Add an optional fixer (#609) (606fc70)
  • eslint-plugin: Add rule no-reference-import (#625) (af70a59)
  • eslint-plugin: add rule strict-boolean-expressions (#579) (34e7d1e)
  • eslint-plugin: added new rule prefer-readonly (#555) (76b89a5)
Commits

The new version differs by 13 commits.

  • cd96c38 chore: publish v1.12.0
  • b30e78d chore(deps): bump lodash.template from 4.4.0 to 4.5.0 (#693)
  • e0aeb18 feat(eslint-plugin): [explicit-function-return-type] add handling for usage as arguments (#680)
  • 6de19d3 fix(typescript-estree): fix async identifier token typed as Keyword (#681)
  • af70a59 feat(eslint-plugin): Add rule no-reference-import (#625)
  • 34e7d1e feat(eslint-plugin): add rule strict-boolean-expressions (#579)
  • 44677b4 docs(eslint-plugin): format array-type docs
  • 44b099d docs(eslint-plugin): Expand docs for array-type (#634)
  • b83ff5a docs: add link to eslint support in TS repo (#650)
  • 430d628 fix(eslint-plugin): handle const; (#633)
  • e325b72 feat(eslint-plugin): [ban-types] Support namespaced type (#616)
  • 606fc70 feat(eslint-plugin): [no-explicit-any] Add an optional fixer (#609)
  • 76b89a5 feat(eslint-plugin): added new rule prefer-readonly (#555)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

How to avoid infinit self calls

if we invoke else service method suck as this.getActions() inside the effectActions[actionName] function in sync way, it will cause an error:

InternalError: "too much recursion"

the effect can be:

  @Effect()
  fetchInfo(url$: Observable<string>):Observable<EffectAction> {
    return url$.pipe(
      switchMap(url => from(client.get(url))),
      mergeMap(data => of(this.getActions().setData(data), this.getActions().setLoading(false))),
      startWith(this.getActions().setLoading(true)),
    )
  }

the effect init function is :

const effect$: Observable<EffectAction> = effectActions[actionName](payload$, state$)

because the startWith is sync, so this.getActions() will request the ikari instance, but the ikari instance is not fully constructed at that time. so it will invoke the create function again and agian...

An in-range update of @types/react is breaking the build 🚨

The devDependency @types/react was updated from 16.8.13 to 16.8.14.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/react is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: build: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

希望effects异步执行完毕能提供回调

现在有比较多的场景都需要effects执行完毕的回调,比如loading,编辑弹窗完成后异步提交结束后关闭弹窗,但是现在的异步actions执行的结果的undefined,无法获取执行完毕的回调,需要通过设置额外的state来标示,然后通过判断state的变化来执行对应的操作,每个类都需要写一遍,感觉有点复杂

An in-range update of @types/react is breaking the build 🚨

The devDependency @types/react was updated from 16.8.16 to 16.8.17.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/react is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: build: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

[RFC]Support async generator as Effect

RxJS is great as process management, but sometimes our Effect dosen't need too much async management ability. So I really want a simpler way to provide async management ability.

@GeneratorEffect()
async fetchUserInfo(payload:  T) {
  const response = await client.query({ ... })
  try {
    yield this.getActions().setUserInfo(assertSuccess(response))
  } catch (e) {
    yield this.getActions().getUserInfoFailed(e)
  }
}

An in-range update of @types/lodash is breaking the build 🚨

The devDependency @types/lodash was updated from 4.14.129 to 4.14.130.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/lodash is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: build: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @typescript-eslint/parser is breaking the build 🚨

The devDependency @typescript-eslint/parser was updated from 2.6.0 to 2.6.1.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@typescript-eslint/parser is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: build: Your tests failed on CircleCI (Details).

Release Notes for v2.6.1

2.6.1 (2019-11-04)

Bug Fixes

  • typescript-estree: don't use typescript's synthetic default (#1156) (17c956e), closes #1153
  • typescript-estree: fix filename handling for vue JSX + markdown (#1127) (366518f)
  • typescript-estree: improve comment parsing code (#1120) (e54998d)
Commits

The new version differs by 4 commits.

  • 643d6d6 chore: publish v2.6.1
  • e54998d fix(typescript-estree): improve comment parsing code (#1120)
  • 366518f fix(typescript-estree): fix filename handling for vue JSX + markdown (#1127)
  • 17c956e fix(typescript-estree): don't use typescript's synthetic default (#1156)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @types/react is breaking the build 🚨

The devDependency @types/react was updated from 16.8.10 to 16.8.11.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/react is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: build: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

connectAyanami不支持scope

目前项目中classComponent比较多,用不了useAyanami hooks,connect方法能提供第三个参数支持scope,跟useAyanami方法保持一致么?

State should be the first param in Reducer

First, we should align behavior with redux reducer, or we need change the name Reducer to something else.

The second, in most case, action & payload is optional, there are too many codes in Modules like :

setLoading(_: void, state: State)

too ugly.

新版本scope特性被移除了?

新版本里useAyanami不支持传入scope了,是基于什么考虑去掉了这个特性呢?后续有没有替代方案支持组件间的数据隔离

An in-range update of @types/lodash is breaking the build 🚨

The devDependency @types/lodash was updated from 4.14.135 to 4.14.136.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/lodash is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: build: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Is there a way to access stores outside React Components?

I want to store some state (for example i18n info) into ayanami modules so that I can get feedback immediately I change the language;
However, I also need to use current i18n info to do sth for example toast some messages. But I am not sure is there a way to access the info stored in the ayanami modules outside React Components just like a getStores function in redux?

An in-range update of @types/express is breaking the build 🚨

The devDependency @types/express was updated from 4.17.1 to 4.17.2.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@types/express is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: build: Your tests passed on CircleCI! (Details).
  • ci/circleci: test: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of @typescript-eslint/eslint-plugin is breaking the build 🚨

The devDependency @typescript-eslint/eslint-plugin was updated from 1.9.0 to 1.10.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

@typescript-eslint/eslint-plugin is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ci/circleci: build: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.