
See the marko-redux sample project for a fully-working example.
npm install redux --savenpm install marko --save
The partial code snippet below shows how a Marko UI component can be connected to a Redux store using the store.subscribe()
method and the Marko forceUpdate()
method:
counter.marko
;class{store;}<div>< ... /></div>
reducer.js
module {state = state ||value: 0;// Additional reducer logic here...return state;};
In counter.marko
, the imported store module exports a Redux store created using the following code:
store.js
EDITvar redux = ;var counter = ;moduleexports = redux;
Helpful? You can thank these awesome people! You can also edit this doc if you see any issues or want to improve it.