• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mobalazs / rotor-framework / 18821915161

25 Oct 2025 02:34AM UTC coverage: 55.776% (-5.1%) from 60.868%
18821915161

push

github

web-flow
Feat/GitHub actions and packages (#2)

fix covl for Coverall upload andminor workflow fixes

1183 of 2121 relevant lines covered (55.78%)

0.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

19.05
/src/source/rotor/base/BaseReducer.bs
1

2
' namespace Reducers
3

4
class Reducer
5

6
    model as object
7
    middlewares = []
8
    middlewareFnScoped as dynamic
9

10
    getDispatcher as function
11
    dispatch as function
12
    ownerDispatcher as object
13
    ownerDispatcherId as string
14
    port as object
15

16
    sub new()
17

18
        frameworkInstance = GetGlobalAA().rotor_framework_helper.frameworkInstance
1✔
19
        m.port = frameworkInstance.port ' Add port to reducer
1✔
20

21
        m.getDispatcher = function(dispatcherId as string) as object
1✔
22
            return GetGlobalAA().rotor_framework_helper.frameworkInstance.dispatcherProvider.getFacade(dispatcherId, m)
23
        end function
24

25
        m.dispatch = sub(intent as object)
1✔
26
            m.ownerDispatcher.dispatch(intent)
27
        end sub
28

29
    end sub
30

31
    public function reducer(state as object, intent as Intent)
32
        return state
×
33
    end function
34

35
    public function applyMiddlewares() as object
36
        return []
×
37
    end function
38

39
    function reduce(state as object, intent as Intent) as object
40
        if intent?.payload <> invalid and intent.payload.Count() > 1 and intent.payload = invalid then throw "[WARNING] Intent payload is invalid."
×
41

42
        ' Resolve middlewares
43
        middlewares = m.applyMiddlewares()
×
44
        mwIndex = 0
×
45
        mwCount = middlewares.Count()
×
46
        while intent <> invalid and mwIndex < mwCount
×
47
            middlewareFnScoped = middlewares[mwIndex]
×
48
            m.middlewareFnScoped = middlewareFnScoped
×
49
            intent = m.middlewareFnScoped(intent, state)
×
50
            mwIndex++
×
51
        end while
52
        m.middlewareFnScoped = invalid ' invalidate scoped fn
×
53
        if intent = invalid then return invalid
×
54

55
        ' Resolve Reducer
56
        newState = m.reducer(state, intent)
×
57

58
        return newState
×
59

60
    end function
61

62
    sub asyncReducerCallback(msg)
63
        ' data = msg.getData()
64
    end sub
65

66
    sub destroy()
67
        m.ownerDispatcher = invalid
×
68
        m.port = invalid
×
69
    end sub
70

71
end class
72

73
' end namespace
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc