MCPcopy Create free account
hub / github.com/LeetCode-OpenSource/ayanami / TipModel

Class TipModel

test/specs/ssr.spec.tsx:74–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74@SSRModule('TipModel')
75class TipModel extends Ayanami<TipState> {
76 defaultState = { tip: '' }
77
78 @ImmerReducer()
79 setTip(state: Draft<TipState>, tip: string) {
80 state.tip = tip
81 }
82
83 @SSREffect()
84 getTip(payload$: Observable<void>): Observable<EffectAction> {
85 return payload$.pipe(
86 mergeMap(() =>
87 timer(1).pipe(
88 map(() => this.getActions().setTip('tip')),
89 endWith(TERMINATE_ACTION),
90 ),
91 ),
92 )
93 }
94}
95
96const Component = () => {
97 const [state, actions] = useAyanami(CountModel)

Callers

nothing calls this directly

Calls 2

SSRModuleFunction · 0.90
SSREffectFunction · 0.90

Tested by

no test coverage detected