GithubHelp home page GithubHelp logo

dev-yong / composable-architecture Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 226 KB

Pointfree에서 제공하는 Composable Architecture 에 대한 공부 기록을 위한 Repository입니다.

Swift 95.65% Objective-C 4.35%

composable-architecture's Introduction

Composable Architecture [WIP]

Pointfree에서 제공하는 Composable Architecture 에 대한 공부 기록을 위한 Repository입니다.

Reducers and Stores

  • Value Semantic을 활용하고 얇은 Wrapper인 Store 를 도입하라.
  • 일관적인 방법으로 mutation을 수행하라.
  • User Action에 대하여 정의하라.
  • BoilerPlate 코드를 없애기 위하여, copy process를 줄이기 위하여 inout 을 이용하자.

State Pullbacks

Action Pullbacks

  • Reducer를 입력으로 사용하고 Reducer를 출력으로 반환하는 Reducer
  • 기능별 Logic 을 한 곳에 집중시킬 수 있다.
  • 아직까지는 composition nesting이 지저분해지는 단점이 존재한다.

Moduler State Management

  • 모듈이란 Application에 import 되어질 수 있는 코드의 단위 이다.
  • Application을 module 단위로 쪼개라.
  • Reducer 들을 자체 모듈로 추출하자.
  • View 들에 대하여 modularizing을 하자.
  • Global Store의 value를 Local Store의 value로 변환하자.
  • Global Store의 파생된 변화를 Local Store가 받도록 하자.
  • AppAction에 의존하는 것을 완전히 분리 시키자.
  • Global Action 대신 Local Action을 보내자.

Side Effects

  • 단순한 synchronous side effect른 만들자.
  • Reducer에 모든 로직을 이동하여 View는 logic-less를 유지하라.
  • 작업 실행의 책임은 Store가 갖는다.
  • effect의 결과를 가져 와서 reducer 바로 되돌리는 방법이 필요로 하다.
  • 데이터는 한 가지 방식으로만 변경된다.
  • Asynchronous한 것을 synchronous effect로 변경해보자.
  • Asynchronous effect를 만들자.
  • Asynchronous effect signagure를 감싸는 struct를 만들다.
  • Asynchronous와 연관된 작업들을 Effect로 만들고, 분리하도록 하자.
  • Effect에 Combine의 publisher를 적용하도록하자.
  • Fire-and-forget, sync, async Effect의 변경된 인터페이스에 대한 대응을 하도록 하자.

Testing

Depednecy

Adaptive State Management

composable-architecture's People

Contributors

dev-yong avatar

Stargazers

 avatar

Watchers

 avatar

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.