2.0.0 • Published 11 months ago

mobx-wouter v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 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

11 months ago

1.2.32

12 months ago

1.2.31

1 year ago

1.2.30

1 year ago

1.2.29

1 year ago

1.2.28

1 year ago

1.2.27

1 year ago

1.2.26

1 year ago

1.2.25

1 year ago

1.2.24

1 year ago

1.2.23

1 year ago

1.2.22

1 year ago

1.2.21

1 year ago

1.2.20

1 year ago

1.2.19

1 year ago

1.2.18

1 year ago

1.2.17

1 year ago

1.2.15

1 year ago

1.2.14

1 year ago

1.2.13

1 year ago

1.2.12

1 year ago

1.2.11

1 year ago

1.2.10

1 year ago

1.2.9

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago