graph LR
TakeLatest>TakeLatest] -.-> |Action| Saga
Saga -->|call| API
API --> |await|Saga
State -.-> select>select]
select --> Saga
Put>Put] -.-> |Action| Reducer
Saga --> Put
一段簡單的範例:
function*handleAction(action){ // get state from state.auth const auth =yieldselect((state)=> state.auth) // async get data. fetchData is the async function. const{ result }=yieldcall((auth)=>fetchData(auth)) // dispatch action. saveData is the action creator. yieldput(actions.saveData(result)) } exportdefaultfunction*rootSaga(){ yieldtakeLatest('ACTION', handleAction) }
I'm a happy Elementary OS user and use it as my default desktop OS (~95%) several month. There are some useful tweakings that help me live with the Linux desktop.
gsettings set org.pantheon.terminal.settings font 'Roboto Mono' gsettings set org.gnome.desktop.interface font-name 'Open Sans 9' gsettings set org.gnome.desktop.interface document-font-name 'Open Sans 10'
I can't use GUI Bluetooth manager to pair with bluetooth device, but these commandline works well for me.
$ bluetoothctl $ agent on $ default-agent $ pairable on $ scan on $ devices (to see the devices and macs that you want to pair) $ pair <dev mac> $ trust <dev mac> $ connect <dev mac>