2.0.0 • Published 7 months ago

mobx-wouter v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

mobx-wouter

NPM version test status build status npm download bundle size

MobX integration with Wouter

What package has

PageViewModelBase, PageViewModel

Simple ViewModel wrapper for pages

Usage:

import { PageViewModelBase } from 'mobx-wouter';

class HomePageVM extends PageViewModelBase<{ pathParam: string }> {
  @observable
  accessor value = 'value';

  mount() {
    super.mount();
    document.title = 'Home';
    // do something
  }
}

withPageViewModel()

HOC for integration PageViewModel with view component of React

Usage:

import { ViewModelProps } from 'mobx-view-model';  
import { withPageViewModel } from 'mobx-wouter';

const HomePageView = observer(({ model }: ViewModelProps<HomePageVM>) => {
  return <div>{`render value - ${model.value}`}</div>
})

export const HomePage = withPageViewModel(HomePageVM)(HomePageView);

withLazyPageViewModel()

Same as withPageViewModel() but with lazy loading view and view model

MobxRouter

Router for client navigation

MobxLocation, MobxHistory, QueryParams and etc

Exports from mobx-location-history

Usage

import { MobxRouter, MobxLocation, MobxHistory, QueryParams } from "mobx-wouter";

const router = new MobxRouter({
  history: //, new MobxLocation()
  location: //, new MobxHistory()
  queryParams: //, new QueryParams(),
  abortSignal: //
})
2.0.0

7 months ago

1.2.32

8 months ago

1.2.31

8 months ago

1.2.30

8 months ago

1.2.29

8 months ago

1.2.28

8 months ago

1.2.27

8 months ago

1.2.26

8 months ago

1.2.25

8 months ago

1.2.24

8 months ago

1.2.23

8 months ago

1.2.22

8 months ago

1.2.21

8 months ago

1.2.20

8 months ago

1.2.19

8 months ago

1.2.18

8 months ago

1.2.17

8 months ago

1.2.15

8 months ago

1.2.14

8 months ago

1.2.13

8 months ago

1.2.12

8 months ago

1.2.11

8 months ago

1.2.10

8 months ago

1.2.9

8 months ago

1.2.8

8 months ago

1.2.7

8 months ago

1.2.6

8 months ago

1.2.5

8 months ago

1.2.4

8 months ago

1.2.3

8 months ago

1.2.2

8 months ago

1.2.1

8 months ago

1.2.0

9 months ago

1.1.3

9 months ago

1.1.2

9 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.0.0

9 months ago

0.0.2

9 months ago

0.0.1

10 months ago